Fix assorted type based compiler warnings

master
Nicholas Brown 2015-06-18 17:26:02 +01:00 committed by Luca Boccassi
parent b5e5aaaf31
commit 7c52031b6d
4 changed files with 6 additions and 6 deletions

View File

@ -2433,7 +2433,7 @@ static int ipfix_send_data(ipfix_exporter* exporter)
DPRINTFL(MSG_VDEBUG, "Sendbuffer contains %u bytes (Set headers + records)", exporter->data_sendbuffer->committed_data_length );
DPRINTFL(MSG_VDEBUG, "Sendbuffer contains %u fields (IPFIX Message header + set headers + records)", exporter->data_sendbuffer->committed );
int tested_length = 0;
int j;
unsigned int j;
/*int k;*/
for (j =0; j < exporter->data_sendbuffer->committed; j++) {
if(exporter->data_sendbuffer->entries[j].iov_len > 0 ) {
@ -2982,7 +2982,7 @@ int ipfix_start_datatemplate (ipfix_exporter *exporter,
Data Templates are (still) a proprietary extension to IPFIX. */
int datatemplate=(fixedfield_count || preceding) ? 1 : 0;
/* Make sure that template_id is > 255 */
if ( ! template_id > 255 ) {
if (!(template_id > 255)) {
msg(MSG_ERROR, "Template id has to be > 255. Start of template cancelled.");
return -1;
}

View File

@ -152,7 +152,7 @@ void PrintHelpers::printUint(InformationElement::IeInfo type, IpfixRecord::Data*
fprintf(fh, "%u",ntohl(*(uint32_t*)data));
return;
case 8:
fprintf(fh, "%Lu",(long long unsigned)ntohll(*(uint64_t*)data));
fprintf(fh, "%llu",(long long unsigned)ntohll(*(uint64_t*)data));
return;
default:
for(uint16_t i = 0; i < type.length; i++) {
@ -188,7 +188,7 @@ void PrintHelpers::printLocaltime(InformationElement::IeInfo type, IpfixRecord::
ctime_r(&tmp, str);
// remove new line
str[24] = '\0';
fprintf(fh, "%Lu (%s)", (long long unsigned)ntohll(*(uint64_t*)data), str);
fprintf(fh, "%llu (%s)", (long long unsigned)ntohll(*(uint64_t*)data), str);
return;
default:
for(uint16_t i = 0; i < type.length; i++) {

View File

@ -59,7 +59,7 @@ typedef struct {
} meter_data;
meter_data my_meter_data[10000];
int my_meter_data_next_free = 0;
unsigned int my_meter_data_next_free = 0;
int parse_command_line_arguments(int argc, char **argv);

View File

@ -38,7 +38,7 @@ void define_template(ipfix_exporter *exporter) {
void put_data(ipfix_exporter *exporter) {
uint8_t data[256];
uint8_t i = 0;
int j;
unsigned int j;
int s;
for (j=0;j<sizeof(data);j++) {
data[j] = j;