Browse Source

Fix some compiler warnings when -Wextra is added to CFLAGS.

pre-master-46
Brian Taylor 11 months ago
committed by Holger Vogt
parent
commit
a7961f1a97
  1. 1
      src/frontend/com_sysinfo.c
  2. 2
      src/frontend/device.c
  3. 20
      src/frontend/inpcom.c
  4. 6
      src/spicelib/parser/inpeval.c

1
src/frontend/com_sysinfo.c

@ -399,6 +399,7 @@ static void set_static_system_info(void)
/* Get memory information */
static int get_sysmem(struct sys_memory *memall)
{
NG_IGNORE(memall);
fprintf(stderr, "System memory info is not available\n");
return -1;
}

2
src/frontend/device.c

@ -1641,11 +1641,13 @@ check_ifparm_compare(const void *a, const void *b)
}
#ifdef HAVE_TDESTROY
static void
check_ifparm_freenode(void *node)
{
NG_IGNORE(node);
}
#endif
static void

20
src/frontend/inpcom.c

@ -2573,7 +2573,7 @@ static void replace_freq(struct card *c, int *line_number)
++keywd;
cp = key;
while (*keywd && !isspace_c(*keywd) && *keywd != '}' &&
cp - key < sizeof key - 1) {
cp - key < (long)(sizeof key - 1)) {
*cp++ = *keywd++;
}
*cp = 0;
@ -6826,7 +6826,7 @@ static void inp_compat(struct card *card)
K13 L2 L3 1
*/
else if (*curr_line == 'k') {
int tokcount = 0;
int tokcount = 0, idx1, idx2;
char* kinst, **ltok, *couple;
cut_line = curr_line;
/* get number of tokens */
@ -6841,20 +6841,20 @@ static void inp_compat(struct card *card)
cut_line = curr_line;
kinst = gettok(&cut_line);
ltok = TMALLOC(char*, tokcount);
for (i = 0; i < tokcount; i++) {
ltok[i] = gettok(&cut_line);
for (idx1 = 0; idx1 < tokcount; idx1++) {
ltok[idx1] = gettok(&cut_line);
}
couple = gettok(&cut_line);
*curr_line = '*';
for (i = 0; i < tokcount - 1; i++)
for (ii = i + 1; ii < tokcount; ii++) {
char* newline = tprintf("%s_%d_%d %s %s %s", kinst, (int)i + 1, (int)ii + 1, ltok[i], ltok[ii], couple);
card = insert_new_line(card, newline, (int)i + 1, currlinenumber, card->linesource);
for (idx1 = 0; idx1 < tokcount - 1; idx1++)
for (idx2 = idx1 + 1; idx2 < tokcount; idx2++) {
char* newline = tprintf("%s_%d_%d %s %s %s", kinst, idx1 + 1, idx2 + 1, ltok[idx1], ltok[idx2], couple);
card = insert_new_line(card, newline, idx1 + 1, currlinenumber, card->linesource);
}
tfree(kinst);
tfree(couple);
for (i = 0; i < tokcount; i++) {
tfree(ltok[i]);
for (idx1 = 0; idx1 < tokcount; idx1++) {
tfree(ltok[idx1]);
}
}
}

6
src/spicelib/parser/inpeval.c

@ -372,7 +372,7 @@ INPevaluateRKM_R(char** line, int* error, int gobble)
int num;
char ch;
if (sscanf(here + 1, "%i%c", &num, &ch) == 1) {
expo1 = expo1;
//expo1 = expo1;
hasmulti = TRUE;
}
else {
@ -612,7 +612,7 @@ INPevaluateRKM_C(char** line, int* error, int gobble)
case 'r':
case 'R':
expo1 = expo1;
//expo1 = expo1;
hasmulti = TRUE;
break;
case 'n':
@ -850,7 +850,7 @@ INPevaluateRKM_L(char** line, int* error, int gobble)
case 'r':
case 'R':
expo1 = expo1;
//expo1 = expo1;
hasmulti = TRUE;
break;
case 'n':

Loading…
Cancel
Save