From e9fcaa7339ecf77b653f156bfcf9a07261b170e1 Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Wed, 26 May 2021 04:39:26 +0100 Subject: [PATCH] Revert "embryo - embryo_cc - silence some new gcc warnings" This reverts commit f4ff12406c9ff4ecf6ebae42b213defff5e92018. hmm - it seems this warning silencing didn't work. revisit... --- src/bin/embryo/embryo_cc_sc1.c | 17 +++-------------- src/bin/embryo/embryo_cc_sc5.scp | 2 +- src/bin/embryo/embryo_cc_sc7.scp | 2 +- 3 files changed, 5 insertions(+), 16 deletions(-) diff --git a/src/bin/embryo/embryo_cc_sc1.c b/src/bin/embryo/embryo_cc_sc1.c index baaecc5fcd..8f25be75b5 100644 --- a/src/bin/embryo/embryo_cc_sc1.c +++ b/src/bin/embryo/embryo_cc_sc1.c @@ -3032,22 +3032,11 @@ insert_constval(constvalue * prev, constvalue * next, char *name, cell val, short idx) { constvalue *cur; - char *s, *d; - if (!(cur = calloc(1, sizeof(constvalue)))) + if (!(cur = (constvalue *)malloc(sizeof(constvalue)))) error(103); /* insufficient memory (fatal error) */ -// strncpy(cur->name, name, sizeof(cur->name) - 1); -// I'm forced to do the below as new gcc warnings I can't seem to shut up -// complain so implement in full to get some silence. - for (d = cur->name, s = name; ; ) - { - *d++ = *s; - if ((size_t)(s - name) < (size_t)(sizeof(cur->name) - 1)) - { - if (*s) s++; - } - else break; - } + memset(cur, 0, sizeof(constvalue)); + strncpy(cur->name, name, sizeof(cur->name) - 1); cur->name[sizeof(cur->name) - 1] = 0; cur->value = val; cur->index = idx; diff --git a/src/bin/embryo/embryo_cc_sc5.scp b/src/bin/embryo/embryo_cc_sc5.scp index 2ff958fb4a..bf0a606dc8 100644 --- a/src/bin/embryo/embryo_cc_sc5.scp +++ b/src/bin/embryo/embryo_cc_sc5.scp @@ -26,7 +26,7 @@ int strexpand(char *dest, unsigned char *source, int maxlen, #define SCPACK_TABLE errstr_table /*-*SCPACK start of pair table, do not change or remove this line */ -unsigned char errstr_table[128][2] = { +unsigned char errstr_table[][2] = { {101, 32}, {116, 32}, {111, 110}, {105, 110}, {97, 114}, {100, 32}, {105, 130}, {101, 114}, {101, 110}, {115, 32}, {97, 108}, {97, 116}, {117, 110}, {115, diff --git a/src/bin/embryo/embryo_cc_sc7.scp b/src/bin/embryo/embryo_cc_sc7.scp index 618a68fbd5..38f784d3cc 100644 --- a/src/bin/embryo/embryo_cc_sc7.scp +++ b/src/bin/embryo/embryo_cc_sc7.scp @@ -29,7 +29,7 @@ int strexpand(char *dest, unsigned char *source, int maxlen, #define SCPACK_TABLE sequences_table /*-*SCPACK start of pair table, do not change or remove this line */ -unsigned char sequences_table[128][2] = { +unsigned char sequences_table[][2] = { {32, 37}, {114, 105}, {112, 129}, {46, 130}, {49, 33}, {128, 132}, {97, 100}, {46, 97}, {135, 108}, {136, 116}, {111, 134}, {108, 138}, {50, 33}, {115, 104},