Skip to content

Commit

Permalink
Suppress warning when compile with DEBUG or/and USE_SYSLOG in CFLAGS
Browse files Browse the repository at this point in the history
  • Loading branch information
scorbeau committed Apr 17, 2018
1 parent fbc3d0a commit 7b9e303
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
8 changes: 6 additions & 2 deletions inc/logs_out.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@
## args); \
fflush(stdout); \
}
#else

#define PRINT_DEBUG(fmt, args...)

#endif

#endif

#ifdef DEBUG
Expand All @@ -94,11 +100,9 @@ void printbuf(void * buf,int size);

#else

#define PRINT_DEBUG(x...)
#define PRINT_DEBUG_BUF(x, y)

#endif

#endif

#endif
1 change: 1 addition & 0 deletions src/logs_out.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "logs_out.h"

#ifdef DEBUG
Expand Down
5 changes: 3 additions & 2 deletions src/mtp_datasets.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <stdint.h>
#include <stdio.h>

#include <inttypes.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
Expand Down Expand Up @@ -99,8 +100,8 @@ int build_storageinfo_dataset(mtp_ctx * ctx,void * buffer, int maxsize,uint32_t
{
totalspace = (uint64_t)fsbuf.f_bsize * (uint64_t)fsbuf.f_blocks;
freespace = (uint64_t)fsbuf.f_bsize * (uint64_t)fsbuf.f_bavail;
PRINT_DEBUG("Total space %llu byte(s)", totalspace);
PRINT_DEBUG("Free space %llu byte(s)", freespace);
PRINT_DEBUG("Total space %" PRIu64 " byte(s)", totalspace);
PRINT_DEBUG("Free space %" PRIu64 " byte(s)", freespace);
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion src/usb_gadget.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ void fill_config_descriptor(mtp_ctx * ctx , usb_gadget * usbctx,struct usb_confi
desc->bmAttributes = USB_CONFIG_ATT_ONE;
desc->bMaxPower = 1;

PRINT_DEBUG("fill_config_descriptor: (Total Len : %d + %d = %d)",sizeof(struct usb_config_descriptor) ,total_size,desc->wTotalLength);
PRINT_DEBUG("fill_config_descriptor: (Total Len : %lu + %d = %d)",sizeof(struct usb_config_descriptor) ,total_size,desc->wTotalLength);
PRINT_DEBUG_BUF(desc, sizeof(struct usb_config_descriptor));

return;
Expand Down

0 comments on commit 7b9e303

Please sign in to comment.