1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

native: fix formating warnings on OS X

This commit is contained in:
Thomas Eichinger 2015-07-14 13:27:21 +02:00
parent 9c4b511e7d
commit cfea6439f6

View File

@ -93,6 +93,7 @@ static inline void _bytes_format(char *format, uint16_t flags)
strncpy(format, " %024" PRIo64, sizeof(" %024" PRIo64));
break;
#if !defined(__MACH__)
case OD_FLAGS_BYTES_OCTAL | OD_FLAGS_LENGTH_SHORT:
sprintf(format, " %%0%dho", sizeof(short) * _OCTAL_BYTE_LENGTH);
break;
@ -100,6 +101,15 @@ static inline void _bytes_format(char *format, uint16_t flags)
case OD_FLAGS_BYTES_OCTAL | OD_FLAGS_LENGTH_LONG:
sprintf(format, " %%0%dlo", sizeof(long) * _OCTAL_BYTE_LENGTH);
break;
#else /* !defined(__MACH__) */
case OD_FLAGS_BYTES_OCTAL | OD_FLAGS_LENGTH_SHORT:
sprintf(format, " %lu", sizeof(short) * _OCTAL_BYTE_LENGTH);
break;
case OD_FLAGS_BYTES_OCTAL | OD_FLAGS_LENGTH_LONG:
sprintf(format, " %lu", sizeof(long) * _OCTAL_BYTE_LENGTH);
break;
#endif /* !defined(__MACH__) */
case OD_FLAGS_BYTES_INT | OD_FLAGS_LENGTH_1:
strncpy(format, " %4" PRId8, sizeof(" %4" PRId8));
@ -117,6 +127,7 @@ static inline void _bytes_format(char *format, uint16_t flags)
strncpy(format, " %24" PRId64, sizeof(" %24" PRId64));
break;
#if !defined(__MACH__)
case OD_FLAGS_BYTES_INT | OD_FLAGS_LENGTH_SHORT:
sprintf(format, " %%%dhd", sizeof(short) * _INT_BYTE_LENGTH);
break;
@ -124,6 +135,15 @@ static inline void _bytes_format(char *format, uint16_t flags)
case OD_FLAGS_BYTES_INT | OD_FLAGS_LENGTH_LONG:
sprintf(format, " %%%dld", sizeof(long) * _INT_BYTE_LENGTH);
break;
#else /* !defined(__MACH__) */
case OD_FLAGS_BYTES_INT | OD_FLAGS_LENGTH_SHORT:
sprintf(format, " %%%ld", sizeof(short) * _INT_BYTE_LENGTH);
break;
case OD_FLAGS_BYTES_INT | OD_FLAGS_LENGTH_LONG:
sprintf(format, " %%%ld", sizeof(long) * _INT_BYTE_LENGTH);
break;
#endif /* !defined(__MACH__) */
case OD_FLAGS_BYTES_UINT | OD_FLAGS_LENGTH_1:
strncpy(format, " %3" PRIu8, sizeof(" %3" PRIu8));
@ -141,6 +161,7 @@ static inline void _bytes_format(char *format, uint16_t flags)
strncpy(format, " %24" PRIu64, sizeof(" %24" PRIu64));
break;
#if !defined(__MACH__)
case OD_FLAGS_BYTES_UINT | OD_FLAGS_LENGTH_SHORT:
sprintf(format, " %%%dhu", sizeof(short) * _INT_BYTE_LENGTH);
break;
@ -148,6 +169,15 @@ static inline void _bytes_format(char *format, uint16_t flags)
case OD_FLAGS_BYTES_UINT | OD_FLAGS_LENGTH_LONG:
sprintf(format, " %%%dlu", sizeof(long) * _INT_BYTE_LENGTH);
break;
#else /* !defined(__MACH__) */
case OD_FLAGS_BYTES_UINT | OD_FLAGS_LENGTH_SHORT:
sprintf(format, " %%%lu", sizeof(short) * _INT_BYTE_LENGTH);
break;
case OD_FLAGS_BYTES_UINT | OD_FLAGS_LENGTH_LONG:
sprintf(format, " %%%lu", sizeof(long) * _INT_BYTE_LENGTH);
break;
#endif /* !defined(__MACH__) */
case OD_FLAGS_BYTES_HEX | OD_FLAGS_LENGTH_1:
strncpy(format, " %02" PRIx8, sizeof(" %02" PRIx8));
@ -165,6 +195,7 @@ static inline void _bytes_format(char *format, uint16_t flags)
strncpy(format, " %016" PRIx64, sizeof(" %016" PRIx64));
break;
#if !defined(__MACH__)
case OD_FLAGS_BYTES_HEX | OD_FLAGS_LENGTH_SHORT:
sprintf(format, " %%0%dhx", sizeof(short) * _HEX_BYTE_LENGTH);
break;
@ -172,6 +203,15 @@ static inline void _bytes_format(char *format, uint16_t flags)
case OD_FLAGS_BYTES_HEX | OD_FLAGS_LENGTH_LONG:
sprintf(format, " %%0%dlx", sizeof(long) * _HEX_BYTE_LENGTH);
break;
#else /* !defined(__MACH__) */
case OD_FLAGS_BYTES_HEX | OD_FLAGS_LENGTH_SHORT:
sprintf(format, " %%0%lx", sizeof(short) * _HEX_BYTE_LENGTH);
break;
case OD_FLAGS_BYTES_HEX | OD_FLAGS_LENGTH_LONG:
sprintf(format, " %%0%lx", sizeof(long) * _HEX_BYTE_LENGTH);
break;
#endif /* !defined(__MACH__) */
default:
break;