Browse Source

Add strict non-void return checking

pull/270/head
miketout 5 years ago
parent
commit
16bc940e77
  1. 6
      src/cc/CCtx.cpp
  2. 1
      src/cc/lotto.cpp
  3. 1
      src/cc/oracles.cpp
  4. 11
      src/mmr.h
  5. 2
      zcutil/build.sh

6
src/cc/CCtx.cpp

@ -33,7 +33,11 @@ bool SignTx(CMutableTransaction &mtx,int32_t vini,int64_t utxovalue,const CScrip
{
UpdateTransaction(mtx,vini,sigdata);
return(true);
} else fprintf(stderr,"signing error for SignTx vini.%d %.8f\n",vini,(double)utxovalue/COIN);
} else
{
fprintf(stderr,"signing error for SignTx vini.%d %.8f\n",vini,(double)utxovalue/COIN);
return(false);
}
#else
return(false);
#endif

1
src/cc/lotto.cpp

@ -295,6 +295,7 @@ std::string LottoCreate(uint64_t txfee,char *planstr,int64_t funding,int32_t tic
mtx.vout.push_back(MakeCC1vout(EVAL_LOTTO,funding,lottopk));
return(FinalizeCCTx(0,cp,mtx,mypk,txfee,CScript() << OP_RETURN << E_MARSHAL(ss << (uint8_t)EVAL_LOTTO << (uint8_t)'F' << sbits << ticketsize << odds << firstheight << period << hentropy)));
}
return "";
}
std::string LottoTicket(uint64_t txfee,uint256 lottoid,int64_t numtickets)

1
src/cc/oracles.cpp

@ -439,6 +439,7 @@ int64_t correlate_price(int32_t height,int64_t *prices,int32_t n)
for (i=0; i<n; i++)
fprintf(stderr,"%llu ",(long long)prices[i]);
fprintf(stderr,"-> %llu ht.%d\n",(long long)price,height);
return (int64_t)price;
}
int64_t OracleCorrelatedPrice(int32_t height,std::vector <int64_t> origprices)

11
src/mmr.h

@ -220,7 +220,11 @@ public:
{
return nodes[idx >> CHUNK_SHIFT][idx & chunkMask()];
}
return NODE_TYPE();
else
{
std::__throw_length_error("CChunkedLayer [] index out of range");
return NODE_TYPE();
}
}
void push_back(NODE_TYPE node)
@ -301,6 +305,11 @@ public:
{
return nodeSource->GetMMRNode(idx);
}
else
{
std::__throw_length_error("COverlayNodeLayer [] index out of range");
return NODE_TYPE();
}
}
// node type must be moveable just to be passed here, but the default overlay has no control over the underlying storage

2
zcutil/build.sh

@ -104,5 +104,5 @@ ld -v
HOST="$HOST" BUILD="$BUILD" NO_PROTON="$PROTON_ARG" "$MAKE" "$@" -C ./depends/ V=1
./autogen.sh
CONFIG_SITE="$PWD/depends/$HOST/share/config.site" ./configure "$HARDENING_ARG" "$LCOV_ARG" "$TEST_ARG" "$MINING_ARG" "$PROTON_ARG" $CONFIGURE_FLAGS CPPFLAGS='-g' CXXFLAGS='-g'
CONFIG_SITE="$PWD/depends/$HOST/share/config.site" ./configure "$HARDENING_ARG" "$LCOV_ARG" "$TEST_ARG" "$MINING_ARG" "$PROTON_ARG" $CONFIGURE_FLAGS CPPFLAGS='-g -Wno-builtin-declaration-mismatch -Werror' CXXFLAGS='-g'
"$MAKE" "$@" V=1

Loading…
Cancel
Save