Remove compiler warnings

Signed-off-by: Gavin Howard <gavin@yzena.com>
computed_goto
Gavin Howard 1 year ago
parent d72062c26f
commit dbe685432b
Signed by: gavin
GPG Key ID: C08038BDF280D33E
  1. 38
      gen/strgen.c
  2. 2
      gen/strgen.sh
  3. 2
      src/num.c
  4. 2
      src/program.c

@ -176,28 +176,28 @@ static int output_label(FILE* out, const char* label, const char* name) {
* Anything surrounded by square brackets may not be in the final generated
* source file.
*
* The required parameters are:
* The required command-line parameters are:
*
* @param input Input filename.
* @param output Output filename.
* @param name The name of the char array.
* input Input filename.
* output Output filename.
* name The name of the char array.
*
* The optional parameters are:
*
* @param label If given, a label for the char array. See the comment for the
* output_label() function. It is meant as a "filename" for the
* text when processed by bc and dc. If label is given, then the
* <Label Extern> and <Label Definition> will exist in the
* generated source file.
* @param define If given, a preprocessor macro that should be used as a guard
* for the char array and its label. If define is given, then
* <Preprocessor Guard Begin> will exist in the form
* "#if <define>" as part of the generated source file, and
* <Preprocessor Guard End> will exist in the form
* "endif // <define>".
* @param rmtabs If this parameter exists, it must be an integer. If it is
* non-zero, then tabs are removed from the input file text
* before outputting to the output char array.
* label If given, a label for the char array. See the comment for the
* output_label() function. It is meant as a "filename" for the
* text when processed by bc and dc. If label is given, then the
* <Label Extern> and <Label Definition> will exist in the
* generated source file.
* define If given, a preprocessor macro that should be used as a guard
* for the char array and its label. If define is given, then
* <Preprocessor Guard Begin> will exist in the form
* "#if <define>" as part of the generated source file, and
* <Preprocessor Guard End> will exist in the form
* "endif // <define>".
* remove_tabs If this parameter exists, it must be an integer. If it is
* non-zero, then tabs are removed from the input file text before
* outputting to the output char array.
*
* All text files that are transformed have license comments. This program finds
* the end of that comment and strips it out as well.
@ -210,7 +210,7 @@ int main(int argc, char *argv[]) {
bool has_label, has_define, remove_tabs;
if (argc < 4) {
printf("usage: %s input output name [label [define [rmtabs]]]\n",
printf("usage: %s input output name [label [define [remove_tabs]]]\n",
argv[0]);
return INVALID_PARAMS;
}

@ -36,7 +36,7 @@ progname=${0##*/}
# script generates a string literal, not a char array. To understand the
# consequences of that, see manuals/development.md#strgenc.
if [ $# -lt 3 ]; then
echo "usage: $progname input output name [label [define [rmtabs]]]"
echo "usage: $progname input output name [label [define [remove_tabs]]]"
exit 1
fi

@ -2463,7 +2463,6 @@ void bc_num_irand(BcNum *restrict a, BcNum *restrict b, BcRNG *restrict rng) {
BcDig rand_num[BC_NUM_BIGDIG_LOG10];
bool carry;
ssize_t cmp;
size_t ascale;
assert(a != b);
@ -2887,7 +2886,6 @@ void bc_num_modexp(BcNum *a, BcNum *b, BcNum *c, BcNum *restrict d) {
BcNum base, exp, two, temp, atemp, btemp, ctemp;
BcDig two_digs[2];
size_t ascale = 0, bscale = 0, cscale = 0;
assert(a != NULL && b != NULL && c != NULL && d != NULL);
assert(a != d && b != d && c != d);

@ -962,7 +962,7 @@ static void bc_program_pushVar(BcProgram *p, const char *restrict code,
if (BC_ERR(!BC_PROG_STACK(v, 2 - copy))) {
const char *name = bc_map_name(&p->var_map, idx);
bc_vm_verr(BC_ERR_EXEC_STACK_REGISTER, name);;
bc_vm_verr(BC_ERR_EXEC_STACK_REGISTER, name);
}
assert(BC_PROG_STACK(v, 2 - copy));

Loading…
Cancel
Save