Skip to content

Commit

Permalink
Squished some GCC 11 warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Futaura committed Oct 22, 2024
1 parent 52698b0 commit 2862c5d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion libcmt/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ FILE *freopen(const char *filename,const char *mode,FILE *stream)
}
stream->file=0l;
}
#endif
if(error)
return NULL;
#endif

if(filename!=NULL)
{
Expand Down
8 changes: 8 additions & 0 deletions libcmt/stdlib_calloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@
/****************************************************************************/

STATIC void *
#ifdef __MEM_DEBUG
__calloc(size_t num_elements,size_t element_size,const char * file,int line)
#else
__calloc(size_t num_elements,size_t element_size)
#endif
{
void * result = NULL;
size_t total_size;
Expand All @@ -69,7 +73,11 @@ calloc(size_t num_elements,size_t element_size)
{
void * result;

#ifdef __MEM_DEBUG
result = __calloc(num_elements,element_size,NULL,0);
#else
result = __calloc(num_elements,element_size);
#endif

return(result);
}
2 changes: 0 additions & 2 deletions libcmt/strings_strcasecmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,5 @@ strcasecmp(const char * _s1, const char * _s2)
result = (int)c1 - (int)c2;
}

out:

return(result);
}
3 changes: 3 additions & 0 deletions libcmt/vsnprintf.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ dopr(char *buffer, size_t maxlen, const char *format, va_list args)
break;
case 'X':
flags |= DP_F_UP;
/* fall through */
case 'x':
flags |= DP_F_UNSIGNED;
if (cflags == DP_C_SHORT)
Expand All @@ -340,6 +341,7 @@ dopr(char *buffer, size_t maxlen, const char *format, va_list args)
break;
case 'E':
flags |= DP_F_UP;
/* fall through */
case 'e':
if (cflags == DP_C_LDOUBLE)
fvalue = va_arg (args, LDOUBLE);
Expand All @@ -348,6 +350,7 @@ dopr(char *buffer, size_t maxlen, const char *format, va_list args)
break;
case 'G':
flags |= DP_F_UP;
/* fall through */
case 'g':
if (cflags == DP_C_LDOUBLE)
fvalue = va_arg (args, LDOUBLE);
Expand Down

0 comments on commit 2862c5d

Please sign in to comment.