diff --git a/src/frontend/dotcards.c b/src/frontend/dotcards.c index de7a7ee3c..15d1af3ac 100644 --- a/src/frontend/dotcards.c +++ b/src/frontend/dotcards.c @@ -633,7 +633,9 @@ gettoks(char *s) /* Transfer i(xx) to xxx#branch only when i is the first character of the token or preceeded by a space. */ - if ((*(l - 1) == 'i' || *(l - 1) == 'I') && (l - 1 == t) || ((l > t + 1) && isspace(*(l-2)))) { + if ((*(l - 1) == 'i' || + ((*(l - 1) == 'I') && (l - 1 == t))) || + ((l > t + 1) && isspace(*(l-2)))) { char buf[513]; sprintf(buf, "%s#branch", l + 1); wl->wl_word = copy(buf); diff --git a/src/frontend/udevices.c b/src/frontend/udevices.c index 14c9b0571..cadcd095e 100644 --- a/src/frontend/udevices.c +++ b/src/frontend/udevices.c @@ -262,6 +262,8 @@ static void clear_name_list(NAME_ENTRY nelist, char *msg) #ifdef TRACE printf("%s\n", msg); print_name_list(nelist); +#else + (void)msg; #endif for (x = nelist; x; x = next) { next = x->next; @@ -1505,7 +1507,7 @@ static struct instance_hdr *create_instance_header(char *line) return hdr; } -char *new_inverter(char *iname, char *node, Xlatorp xlp) +static char *new_inverter(char *iname, char *node, Xlatorp xlp) { /* Return the name of the output of the new inverter */ /* tfree the returned string after it has been used by the caller */ @@ -2469,7 +2471,7 @@ static void estimate_typ(struct timing_data *tdp) if (strlen(tmpmin) > 0 && strlen(tmpmax) > 0) { valmin = strtof(tmpmin, &units1); valmax = strtof(tmpmax, &units2); - average = (valmin + valmax) / (float)2.0; + average = (float)((valmin + valmax) / 2.0); tdp->ave = tprintf("%.2f%s", average, units2); if (!eq(units1, units2)) { printf("WARNING units do not match\n"); diff --git a/src/main.c b/src/main.c index fb019df77..7923c6201 100644 --- a/src/main.c +++ b/src/main.c @@ -810,7 +810,7 @@ int main(int argc, char **argv) bool qflag = FALSE; /* flag for command completion */ FILE * volatile circuit_file; - bool oflag = FALSE; + bool volatile oflag = FALSE; bool srflag = FALSE; #ifdef TRACE diff --git a/src/xspice/cmpp/file_buffer.c b/src/xspice/cmpp/file_buffer.c index 27a9d10ff..0c2a084f1 100644 --- a/src/xspice/cmpp/file_buffer.c +++ b/src/xspice/cmpp/file_buffer.c @@ -482,7 +482,7 @@ static size_t fb_make_space_at_end(FILEBUF *p_fb) /* Shift data in use to the front of the buffer if not already */ if (p_dst != p_src) { /* object is not at start of buffer */ - const size_t n = p_fb->p_data_end - p_src; + const size_t n = (size_t)(p_fb->p_data_end - p_src); if (n > 0) { /* Will be 0 if skipping whitespace and comments */ (void) memmove(p_dst, p_src, n); } @@ -528,7 +528,7 @@ static size_t fb_make_space_at_end(FILEBUF *p_fb) } } - return p_fb->p_buf_end - p_fb->p_data_end; + return (size_t)(p_fb->p_buf_end - p_fb->p_data_end); } /* end of function fb_make_space_at_end */ @@ -689,7 +689,7 @@ static int fb_return_string(FILEBUF *p_fb, { const char *p_data_start = p_fbobj->str_value.sz = p_fb->p_obj_start; - p_fbobj->str_value.n_char = p_fb->p_obj_end - p_data_start; + p_fbobj->str_value.n_char = (size_t)(p_fb->p_obj_end - p_data_start); *p_type_found = BUF_TYPE_STRING; return 0; } /* end of function fb_return_string */ diff --git a/src/xspice/cmpp/pp_lst.c b/src/xspice/cmpp/pp_lst.c index 31946a825..1edaaf226 100644 --- a/src/xspice/cmpp/pp_lst.c +++ b/src/xspice/cmpp/pp_lst.c @@ -471,12 +471,12 @@ EXITPOINT: /* If error, free model info */ if (xrc != 0) { - free_model_info(n_model_info, p_model_info); + free_model_info((int)n_model_info, p_model_info); n_model_info = 0; p_model_info = (Model_Info_t *) NULL; } - *p_num_model_info = n_model_info; + *p_num_model_info = (int)n_model_info; *pp_model_info = p_model_info; return xrc; @@ -648,12 +648,12 @@ EXITPOINT: /* If error, free node info */ if (xrc != 0) { - free_node_info(n_node_info, p_node_info); + free_node_info((int)n_node_info, p_node_info); n_node_info = 0; p_node_info = (Node_Info_t *) NULL; } - *p_num_node_info = n_node_info; + *p_num_node_info = (int)n_node_info; *pp_node_info = p_node_info; return xrc; @@ -945,8 +945,8 @@ static int check_uniqueness( } /* Sizes of models and nodes */ - const unsigned int n_model = (unsigned int) numSPICEmodels + num_models; - const unsigned int n_node = (unsigned int) numUDNidentifiers + num_nodes; + const unsigned int n_model = (unsigned int)(numSPICEmodels + num_models); + const unsigned int n_node = (unsigned int)(numUDNidentifiers + num_nodes); const unsigned int n_ks = n_model > n_node ? n_model : n_node; /* Allocate structure to compare */ @@ -994,8 +994,8 @@ static int check_uniqueness( } /* Test for duplicates */ - f_have_duplicate |= test_for_duplicates(num_models, p_ks, - &report_error_function_name); + f_have_duplicate |= test_for_duplicates((unsigned int)num_models, + p_ks, &report_error_function_name); } } @@ -1588,14 +1588,14 @@ static int read_udn_type_name( c = fgetc(fp); if(c == '"') { found = true; - if (i >= sizeof name) { + if (i >= (int)sizeof name) { print_error("name too long"); exit(1); } name[i] = '\0'; } else if(c != EOF) { - if (i > sizeof name) { + if (i > (int)sizeof name) { print_error("name too long"); exit(1); } diff --git a/src/xspice/cmpp/writ_ifs.c b/src/xspice/cmpp/writ_ifs.c index e452e3f62..941abf4ef 100644 --- a/src/xspice/cmpp/writ_ifs.c +++ b/src/xspice/cmpp/writ_ifs.c @@ -1220,7 +1220,7 @@ static char *value_to_str(Data_Type_t type, Value_t value) str_len = (int) strlen(value.svalue); if ((str_len + BASE_STR_LEN) > max_len) { int n_byte_alloc = max_len + str_len + 1; - void * const p = realloc(str, n_byte_alloc); + void * const p = realloc(str, (size_t)n_byte_alloc); if (p == NULL) { (void) fprintf(stderr, "Unable to resize string buffer to size %d.\n",