fix some reported warnings

This commit is contained in:
nhmall
2025-05-26 20:06:20 -04:00
parent 956c826223
commit 62f9b0d15c
3 changed files with 17 additions and 28 deletions
+10 -7
View File
@@ -39,26 +39,29 @@
#define HAS_INTTYPES_H #define HAS_INTTYPES_H
#else /*!__DECC*/ #else /*!__DECC*/
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \ #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L)
&& !defined(HAS_STDINT_H) #if !defined(HAS_STDINT_H)
/* The compiler claims to conform to C99. Use stdint.h */ /* The compiler claims to conform to C99. Use stdint.h */
#define HAS_STDINT_H #define HAS_STDINT_H
#endif #endif /* !HAS_STDINT_H */
#if !defined(HAS_INTTYPES_H)
/* The compiler claims to conform to C99. Use inttypes.h */
#define HAS_INTTYPES_H
#endif /* claims to be C99 */
#if defined(__GNUC__) && defined(__INT64_MAX__) && !defined(HAS_STDINT_H) #if defined(__GNUC__) && defined(__INT64_MAX__) && !defined(HAS_STDINT_H)
#define HAS_STDINT_H #define HAS_STDINT_H
#endif #endif
#endif
#endif /*?__DECC*/ #endif /*?__DECC*/
#ifdef HAS_STDINT_H #ifdef HAS_STDINT_H
#include <stdint.h> #include <stdint.h>
#define SKIP_STDINT_WORKAROUND #define SKIP_STDINT_WORKAROUND
#else /*!stdint*/ #endif
#ifdef HAS_INTTYPES_H #ifdef HAS_INTTYPES_H
#include <inttypes.h> #include <inttypes.h>
#define SKIP_STDINT_WORKAROUND #endif /* HAS_INTTYPES_H */
#endif
#endif /*?stdint*/
#ifndef SKIP_STDINT_WORKAROUND /* !C99 */ #ifndef SKIP_STDINT_WORKAROUND /* !C99 */
/* /*
-1
View File
@@ -85,7 +85,6 @@ staticfn boolean cnf_line_CRASHREPORTURL(char *);
staticfn boolean cnf_line_ACCESSIBILITY(char *); staticfn boolean cnf_line_ACCESSIBILITY(char *);
staticfn boolean cnf_line_PORTABLE_DEVICE_PATHS(char *); staticfn boolean cnf_line_PORTABLE_DEVICE_PATHS(char *);
staticfn void parseformat(int *, char *);
#endif /* SYSCF */ #endif /* SYSCF */
#ifndef SFCTOOL #ifndef SFCTOOL
staticfn boolean cnf_line_BOULDER(char *); staticfn boolean cnf_line_BOULDER(char *);
+7 -20
View File
@@ -4,6 +4,7 @@
#include "hack.h" #include "hack.h"
#include "sfprocs.h" #include "sfprocs.h"
#ifdef SFCTOOL #ifdef SFCTOOL
//#include "sfproto.h" //#include "sfproto.h"
#endif #endif
@@ -499,15 +500,9 @@ char *
sfvalue_any(anything *a) sfvalue_any(anything *a)
{ {
static char buf[20]; static char buf[20];
#ifdef UNIX
Snprintf(buf, sizeof buf, Snprintf(buf, sizeof buf,
"%ld", PRId64,
a->a_int64); (int64_t) a->a_int64);
#else
Snprintf(buf, sizeof buf,
"%lld",
a->a_int64);
#endif
return buf; return buf;
} }
@@ -533,18 +528,14 @@ char * sfvalue_int32(int32 *a)
{ {
static char buf[20]; static char buf[20];
Snprintf(buf, sizeof buf, "%d", *a); Snprintf(buf, sizeof buf, PRId32, *a);
return buf; return buf;
} }
char * sfvalue_int64(int64 *a) char * sfvalue_int64(int64 *a)
{ {
static char buf[20]; static char buf[20];
#ifdef UNIX Snprintf(buf, sizeof buf, PRId64, *a);
Snprintf(buf, sizeof buf, "%ld", *a);
#else
Snprintf(buf, sizeof buf, "%lld", *a);
#endif
return buf; return buf;
} }
@@ -570,7 +561,7 @@ char * sfvalue_uint32(uint32 *a)
{ {
static char buf[20]; static char buf[20];
Snprintf(buf, sizeof buf, "%u", *a); Snprintf(buf, sizeof buf, PRIu32, *a);
return buf; return buf;
} }
@@ -578,11 +569,7 @@ char * sfvalue_uint64(uint64 *a)
{ {
static char buf[20]; static char buf[20];
#ifdef UNIX Snprintf(buf, sizeof buf, PRId64, *a);
Snprintf(buf, sizeof buf, "%lu", *a);
#else
Snprintf(buf, sizeof buf, "%llu", *a);
#endif
return buf; return buf;
} }