diff --git a/fakeradio.c b/fakeradio.c index 2ca3be4f..026e5f05 100644 --- a/fakeradio.c +++ b/fakeradio.c @@ -355,7 +355,7 @@ void transfer_bytes(struct radio_state *radios) if (bytes>0){ log_time(); - fprintf(stderr, "Transferring %d byte packet from %s to %s\n", bytes, t->name, r->name); + fprintf(stderr, "Transferring %zd byte packet from %s to %s\n", bytes, t->name, r->name); } unsigned i, j; diff --git a/overlay_buffer.c b/overlay_buffer.c index cfb278b7..41497bc5 100644 --- a/overlay_buffer.c +++ b/overlay_buffer.c @@ -246,7 +246,7 @@ void _ob_append_byte(struct __sourceloc __whence, struct overlay_buffer *b, unsi if (ob_makespace(b, bytes)) { b->bytes[b->position] = byte; if (config.debug.overlaybuffer) - DEBUGF("ob_append_byte(b=%p, byte=0x%02x) %p[%d]=%02x position=%zu", b, byte, b->bytes, b->position, byte, b->position + bytes); + DEBUGF("ob_append_byte(b=%p, byte=0x%02x) %p[%zd]=%02x position=%zu", b, byte, b->bytes, b->position, byte, b->position + bytes); } else { if (config.debug.overlaybuffer) DEBUGF("ob_append_byte(b=%p, byte=0x%02x) OVERRUN position=%zu", b, byte, b->position + bytes); @@ -293,7 +293,7 @@ void _ob_append_ui16(struct __sourceloc __whence, struct overlay_buffer *b, uint b->bytes[b->position] = (v >> 8) & 0xFF; b->bytes[b->position+1] = v & 0xFF; if (config.debug.overlaybuffer) - DEBUGF("ob_append_ui16(b=%p, v=%u) %p[%d]=%s position=%zu", b, v, b->bytes, b->position, alloca_tohex(&b->bytes[b->position], bytes), b->position + bytes); + DEBUGF("ob_append_ui16(b=%p, v=%u) %p[%zd]=%s position=%zu", b, v, b->bytes, b->position, alloca_tohex(&b->bytes[b->position], bytes), b->position + bytes); } else { if (config.debug.overlaybuffer) DEBUGF("ob_append_ui16(b=%p, v=%u) OVERRUN position=%zu", b, v, b->position + bytes); @@ -310,7 +310,7 @@ void _ob_append_ui32(struct __sourceloc __whence, struct overlay_buffer *b, uint b->bytes[b->position+2] = (v >> 8) & 0xFF; b->bytes[b->position+3] = v & 0xFF; if (config.debug.overlaybuffer) - DEBUGF("ob_append_ui32(b=%p, v=%"PRIu32") %p[%d]=%s position=%zu", + DEBUGF("ob_append_ui32(b=%p, v=%"PRIu32") %p[%zd]=%s position=%zu", b, v, b->bytes, b->position, alloca_tohex(&b->bytes[b->position], bytes), b->position + bytes); } else { if (config.debug.overlaybuffer) @@ -332,7 +332,7 @@ void _ob_append_ui64(struct __sourceloc __whence, struct overlay_buffer *b, uint b->bytes[b->position+6] = (v >> 8) & 0xFF; b->bytes[b->position+7] = v & 0xFF; if (config.debug.overlaybuffer) - DEBUGF("ob_append_ui64(b=%p, v=%"PRIu64") %p[%d]=%s position=%zu", + DEBUGF("ob_append_ui64(b=%p, v=%"PRIu64") %p[%zd]=%s position=%zu", b, v, b->bytes, b->position, alloca_tohex(&b->bytes[b->position], bytes), b->position + bytes); } else { if (config.debug.overlaybuffer) @@ -530,7 +530,7 @@ void _ob_set_ui16(struct __sourceloc __whence, struct overlay_buffer *b, size_t b->bytes[offset] = (v >> 8) & 0xFF; b->bytes[offset+1] = v & 0xFF; if (config.debug.overlaybuffer) - DEBUGF("ob_set_ui16(b=%p, offset=%d, v=%u) %p[%d]=%s", b, offset, v, b->bytes, offset, alloca_tohex(&b->bytes[offset], bytes)); + DEBUGF("ob_set_ui16(b=%p, offset=%zd, v=%u) %p[%zd]=%s", b, offset, v, b->bytes, offset, alloca_tohex(&b->bytes[offset], bytes)); } void _ob_set(struct __sourceloc __whence, struct overlay_buffer *b, size_t offset, unsigned char byte) @@ -541,7 +541,7 @@ void _ob_set(struct __sourceloc __whence, struct overlay_buffer *b, size_t offse assert(offset + bytes <= b->allocSize); b->bytes[offset] = byte; if (config.debug.overlaybuffer) - DEBUGF("ob_set(b=%p, offset=%d, byte=0x%02x) %p[%d]=%s", b, offset, byte, b->bytes, offset, alloca_tohex(&b->bytes[offset], bytes)); + DEBUGF("ob_set(b=%p, offset=%zd, byte=0x%02x) %p[%zd]=%s", b, offset, byte, b->bytes, offset, alloca_tohex(&b->bytes[offset], bytes)); } void _ob_patch_rfs(struct __sourceloc __whence, struct overlay_buffer *b) diff --git a/overlay_mdp.c b/overlay_mdp.c index eae40e67..b9cd1f8d 100644 --- a/overlay_mdp.c +++ b/overlay_mdp.c @@ -773,7 +773,7 @@ static int overlay_send_frame( return -1; } if (config.debug.mdprequests) { - DEBUGF("Send frame %u bytes", ob_position(plaintext)); + DEBUGF("Send frame %zu bytes", ob_position(plaintext)); dump("Frame plaintext", ob_ptr(plaintext), ob_position(plaintext)); } diff --git a/overlay_packetformats.c b/overlay_packetformats.c index 235004fa..1ff83556 100644 --- a/overlay_packetformats.c +++ b/overlay_packetformats.c @@ -439,7 +439,7 @@ int packetOkOverlay(struct overlay_interface *interface,unsigned char *packet, s if (config.debug.overlayframes) dump("Payload Header", header_start, current - header_start); - ret = WHYF("Invalid payload length (%d)", payload_len); + ret = WHYF("Invalid payload length (%zd)", payload_len); goto end; } break; @@ -448,7 +448,7 @@ int packetOkOverlay(struct overlay_interface *interface,unsigned char *packet, s int next_payload = ob_position(b) + payload_len; if (config.debug.overlayframes){ - DEBUGF("Received payload type %x, len %d", f.type, payload_len); + DEBUGF("Received payload type %x, len %zd", f.type, payload_len); DEBUGF("Payload from %s", f.source?alloca_tohex_sid_t(f.source->sid):"NULL"); DEBUGF("Payload to %s", (f.destination?alloca_tohex_sid_t(f.destination->sid):"broadcast")); if (!is_all_matching(f.broadcast_id.id, BROADCAST_LEN, 0)) diff --git a/overlay_queue.c b/overlay_queue.c index 88f73817..5c48965b 100644 --- a/overlay_queue.c +++ b/overlay_queue.c @@ -471,7 +471,7 @@ overlay_stuff_packet(struct outgoing_packet *packet, overlay_txqueue *queue, tim frame->transmit_count++; if (config.debug.overlayframes){ - DEBUGF("Appended payload %p, %d type %x len %d for %s via %s", + DEBUGF("Appended payload %p, %d type %x len %zd for %s via %s", frame, frame->mdp_sequence, frame->type, ob_position(frame->payload), frame->destination?alloca_tohex_sid_t(frame->destination->sid):"All", diff --git a/radio_link.c b/radio_link.c index 43174532..c3a2e53b 100644 --- a/radio_link.c +++ b/radio_link.c @@ -431,7 +431,7 @@ static int radio_link_parse(struct overlay_interface *interface, struct radio_li if (payload[4]&0x80) { if (config.debug.radio_link) - DEBUGF("PDU Complete (length=%d)",state->packet_length); + DEBUGF("PDU Complete (length=%zd)",state->packet_length); packetOkOverlay(interface, state->dst, state->packet_length, NULL); state->packet_length=sizeof(state->dst)+1; diff --git a/rhizome_direct_http.c b/rhizome_direct_http.c index 53dd7e06..7faa9140 100644 --- a/rhizome_direct_http.c +++ b/rhizome_direct_http.c @@ -423,7 +423,7 @@ static int receive_http_response(int sock, char *buffer, size_t buffer_len, stru ssize_t count; do { if ((count = read(sock, &buffer[len], buffer_len - len)) == -1) - return WHYF_perror("read(%d, %p, %d)", sock, &buffer[len], (int)buffer_len - len); + return WHYF_perror("read(%d, %p, %d)", sock, &buffer[len], (int)(buffer_len - len)); len += (size_t)count; } while (len < buffer_len && count != 0 && !is_http_header_complete(buffer, len, len)); if (config.debug.rhizome_rx) diff --git a/rhizome_packetformats.c b/rhizome_packetformats.c index 8ea6027b..21b89048 100644 --- a/rhizome_packetformats.c +++ b/rhizome_packetformats.c @@ -315,7 +315,7 @@ int overlay_rhizome_saw_advertisements(struct decode_context *context, struct ov unsigned char *data = ob_get_bytes_ptr(f->payload, manifest_length); if (!data) { - WHYF("Illegal manifest length field in rhizome advertisement frame %zu vs %d", + WHYF("Illegal manifest length field in rhizome advertisement frame %zu vs %zd", manifest_length, ob_remaining(f->payload)); break; } @@ -408,7 +408,7 @@ next: unsigned char *bar; bars[bar_count]=bar=ob_get_bytes_ptr(f->payload, RHIZOME_BAR_BYTES); if (!bar){ - WARNF("Expected whole BAR @%x (only %d bytes remain)", ob_position(f->payload), ob_remaining(f->payload)); + WARNF("Expected whole BAR @%zx (only %zd bytes remain)", ob_position(f->payload), ob_remaining(f->payload)); break; }