diff --git a/inc/logs_out.h b/inc/logs_out.h index 00814d2..29d3bf3 100644 --- a/inc/logs_out.h +++ b/inc/logs_out.h @@ -45,16 +45,16 @@ void timestamp(char * timestr, int maxsize); #ifdef USE_SYSLOG // Syslog usage -#define PRINT_MSG(fmt, args...) syslog(LOG_NOTICE, "[uMTPrd - Info] " fmt "\n", \ - ## args) +#define PRINT_MSG(fmt, args...) syslog(LOG_NOTICE, "[uMTPrd - Info] " fmt "\n", \ + ## args) #define PRINT_ERROR(fmt, args...) syslog(LOG_ERR, "[uMTPrd - Error] " fmt "\n", \ - ## args) + ## args) #define PRINT_WARN(fmt, args...) syslog(LOG_WARNING, "[uMTPrd - Warning] " fmt "\n", \ - ## args) + ## args) #ifdef DEBUG #define PRINT_DEBUG(fmt, args...) syslog(LOG_DEBUG, "[uMTPrd - Debug] " fmt "\n", \ - ## args) + ## args) #else #define PRINT_DEBUG(fmt, args...) @@ -63,42 +63,42 @@ void timestamp(char * timestr, int maxsize); #else // Stdout usage -#define PRINT_MSG(fmt, args...) do { \ - char timestr[32]; \ - timestamp((char*)×tr, sizeof(timestr)); \ - fprintf(stdout, \ - "[uMTPrd - %s - Info] " fmt "\n",(char*)×tr, \ - ## args); \ - fflush(stdout); \ - } while (0) - -#define PRINT_ERROR(fmt, args...) do { \ - char timestr[32]; \ - timestamp((char*)×tr, sizeof(timestr)); \ - fprintf(stderr, \ - "[uMTPrd - %s - Error] " fmt "\n",(char*)×tr, \ - ## args); \ - fflush(stderr); \ - } while (0) - -#define PRINT_WARN(fmt, args...) do { \ - char timestr[32]; \ - timestamp((char*)×tr, sizeof(timestr)); \ - fprintf(stdout, \ - "[uMTPrd - %s - Warning] " fmt "\n",(char*)×tr, \ - ## args); \ - fflush(stdout); \ - } while (0) +#define PRINT_MSG(fmt, args...) do { \ + char timestr[32]; \ + timestamp((char*)×tr, sizeof(timestr)); \ + fprintf(stdout, \ + "[uMTPrd - %s - Info] " fmt "\n",(char*)×tr, \ + ## args); \ + fflush(stdout); \ + } while (0) + +#define PRINT_ERROR(fmt, args...) do { \ + char timestr[32]; \ + timestamp((char*)×tr, sizeof(timestr)); \ + fprintf(stderr, \ + "[uMTPrd - %s - Error] " fmt "\n",(char*)×tr, \ + ## args); \ + fflush(stderr); \ + } while (0) + +#define PRINT_WARN(fmt, args...) do { \ + char timestr[32]; \ + timestamp((char*)×tr, sizeof(timestr)); \ + fprintf(stdout, \ + "[uMTPrd - %s - Warning] " fmt "\n",(char*)×tr, \ + ## args); \ + fflush(stdout); \ + } while (0) #ifdef DEBUG -#define PRINT_DEBUG(fmt, args...) do { \ - char timestr[32]; \ - timestamp((char*)×tr, sizeof(timestr)); \ - fprintf(stdout, \ - "[uMTPrd - %s - Debug] " fmt "\n",(char*)×tr, \ - ## args); \ - fflush(stdout); \ - } while (0) +#define PRINT_DEBUG(fmt, args...) do { \ + char timestr[32]; \ + timestamp((char*)×tr, sizeof(timestr)); \ + fprintf(stdout, \ + "[uMTPrd - %s - Debug] " fmt "\n",(char*)×tr, \ + ## args); \ + fflush(stdout); \ + } while (0) #else #define PRINT_DEBUG(fmt, args...) diff --git a/src/mtp.c b/src/mtp.c index 01937cb..50b1b2e 100644 --- a/src/mtp.c +++ b/src/mtp.c @@ -722,10 +722,10 @@ uint32_t mtp_add_storage(mtp_ctx * ctx, char * path, char * description, int uid ctx->storages[i].storage_id = 0xFFFF0000 + (i + 1); PRINT_DEBUG("mtp_add_storage : Storage %.8X mapped to %s (%s) (Flags: 0x%.8X)", - ctx->storages[i].storage_id, - ctx->storages[i].root_path, - ctx->storages[i].description, - ctx->storages[i].flags); + ctx->storages[i].storage_id, + ctx->storages[i].root_path, + ctx->storages[i].description, + ctx->storages[i].flags); return ctx->storages[i].storage_id; } @@ -785,8 +785,8 @@ uint32_t mtp_get_storage_id_by_name(mtp_ctx * ctx, char * name) if( !strcmp(ctx->storages[i].description, name ) ) { PRINT_DEBUG("%s : %s -> %.8X", - __func__, - ctx->storages[i].root_path, + __func__, + ctx->storages[i].root_path, ctx->storages[i].storage_id); return ctx->storages[i].storage_id; @@ -812,8 +812,8 @@ int mtp_get_storage_index_by_name(mtp_ctx * ctx, char * name) if( !strcmp(ctx->storages[i].description, name ) ) { PRINT_DEBUG("%s : %s -> %.8X", - __func__, - ctx->storages[i].root_path, + __func__, + ctx->storages[i].root_path, i); return i; @@ -839,9 +839,9 @@ int mtp_get_storage_index_by_id(mtp_ctx * ctx, uint32_t storage_id) if( ctx->storages[i].storage_id == storage_id ) { PRINT_DEBUG("%s : %.8X -> %d", - __func__, - storage_id, - i ); + __func__, + storage_id, + i ); return i; } } @@ -865,9 +865,9 @@ char * mtp_get_storage_root(mtp_ctx * ctx, uint32_t storage_id) if( ctx->storages[i].storage_id == storage_id ) { PRINT_DEBUG("%s : %.8X -> %s", - __func__, - storage_id, - ctx->storages[i].root_path ); + __func__, + storage_id, + ctx->storages[i].root_path ); return ctx->storages[i].root_path; } } @@ -890,9 +890,9 @@ char * mtp_get_storage_description(mtp_ctx * ctx, uint32_t storage_id) if( ctx->storages[i].storage_id == storage_id ) { PRINT_DEBUG("%s : %.8X -> %s", - __func__, - storage_id, - ctx->storages[i].description ); + __func__, + storage_id, + ctx->storages[i].description ); return ctx->storages[i].description; } } @@ -916,9 +916,9 @@ uint32_t mtp_get_storage_flags(mtp_ctx * ctx, uint32_t storage_id) if( ctx->storages[i].storage_id == storage_id ) { PRINT_DEBUG("%s : %.8X -> 0x%.8X", - __func__, - storage_id, - ctx->storages[i].flags ); + __func__, + storage_id, + ctx->storages[i].flags ); return ctx->storages[i].flags; } } diff --git a/src/mtp_cfg.c b/src/mtp_cfg.c index 8d3ebbc..9d42d66 100644 --- a/src/mtp_cfg.c +++ b/src/mtp_cfg.c @@ -233,7 +233,7 @@ int test_flag(char * str, char * flag, char * param) if(!strncmp(&str[i],flag,strlen(flag))) { if( (previous_char == 0 || previous_char == ',') && \ - (str[i + flaglen] == 0 || str[i + flaglen] == ',' || str[i + flaglen] == '=') ) + (str[i + flaglen] == 0 || str[i + flaglen] == ',' || str[i + flaglen] == '=') ) { if(param && str[i + flaglen] == '=') { diff --git a/src/mtp_operations/mtp_op_getdeviceinfos.c b/src/mtp_operations/mtp_op_getdeviceinfos.c index c8ee794..388b003 100644 --- a/src/mtp_operations/mtp_op_getdeviceinfos.c +++ b/src/mtp_operations/mtp_op_getdeviceinfos.c @@ -41,7 +41,7 @@ uint32_t mtp_op_GetDeviceInfos(mtp_ctx * ctx,MTP_PACKET_HEADER * mtp_packet_hdr, { int sz,tmp_sz; - // Note : From the MTP specification this operation can be used without first + // Note : From the MTP specification this operation can be used without first // opening an MTP session by sending an OpenSession command ! sz = build_response(ctx, mtp_packet_hdr->tx_id, MTP_CONTAINER_TYPE_DATA, mtp_packet_hdr->code, ctx->wrbuffer, ctx->usb_wr_buffer_max_size,0,0); diff --git a/src/usbstring.c b/src/usbstring.c index b93d402..6df3b26 100644 --- a/src/usbstring.c +++ b/src/usbstring.c @@ -221,7 +221,7 @@ int unicode2charstring(char * str, uint16_t * unicodestr, int maxstrsize) byte_access += 2; if(!chunksize) - { // Error -> default character + { // Error -> default character tmpstr[0] = '?'; tmpstr[1] = 0; chunksize = 1;