Use %d instead of %i

%d and %i has the same meaning when used in format string for printf.
The linter will warn when using %i. %i was only added to provide
symmetry between scanf() and printf().

Change-Id: Icd5f5f9b0d2ed8fd82afa406787acb4bd95358bf
This commit is contained in:
Alexander Couzens
2024-09-23 23:01:38 +02:00
parent 5b289e83cf
commit 7138f8eb93
6 changed files with 16 additions and 16 deletions

View File

@@ -186,7 +186,7 @@ int sgsn_ranap_iu_event(struct ranap_ue_conn_ctx *ctx, enum ranap_iu_event_type
rc = 0;
break;
default:
LOGMMCTXP(LOGL_NOTICE, mm, "Unknown event received: %i\n", type);
LOGMMCTXP(LOGL_NOTICE, mm, "Unknown event received: %d\n", type);
rc = -1;
break;
}

View File

@@ -388,7 +388,7 @@ found:
DEBUGP(DSLHC, "slhc_compress(): Unexpected change: th->doff != cs->cs_tcp.doff\n");
if(ip->ihl > 5 && memcmp(ip+1,cs->cs_ipopt,((ip->ihl)-5)*4) != 0) {
DEBUGP(DSLHC, "slhc_compress(): Unexpected change: (ip->ihl > 5 && memcmp(ip+1,cs->cs_ipopt,((ip->ihl)-5)*4) != 0)\n");
DEBUGP(DSLHC, "slhc_compress(): ip->ihl = %i\n", ip->ihl);
DEBUGP(DSLHC, "slhc_compress(): ip->ihl = %d\n", ip->ihl);
DEBUGP(DSLHC, "slhc_compress(): ip+1 = %s\n",
osmo_hexdump_nospc((uint8_t*)(ip+1),((ip->ihl)-5)*4));
DEBUGP(DSLHC, "slhc_compress(): Unexpected change: cs->cs_ipopt = %s\n",
@@ -396,7 +396,7 @@ found:
}
if(th->doff > 5 && memcmp(th+1,cs->cs_tcpopt,((th->doff)-5)*4) != 0) {
DEBUGP(DSLHC, "slhc_compress(): Unexpected change: (th->doff > 5 && memcmp(th+1,cs->cs_tcpopt,((th->doff)-5)*4) != 0)\n");
DEBUGP(DSLHC, "slhc_compress(): th->doff = %i\n", th->doff);
DEBUGP(DSLHC, "slhc_compress(): th->doff = %d\n", th->doff);
DEBUGP(DSLHC, "slhc_compress(): th+1 = %s\n",
osmo_hexdump_nospc((uint8_t*)(th+1),((th->doff)-5)*4));
DEBUGP(DSLHC, "slhc_compress(): cs->cs_tcpopt = %s\n",
@@ -538,8 +538,8 @@ found:
cp += 2;
/* deltaS is now the size of the change section of the compressed header */
DEBUGP(DSLHC, "slhc_compress(): Delta-list length (deltaS) = %li\n",deltaS);
DEBUGP(DSLHC, "slhc_compress(): Original header len (hlen) = %i\n",hlen);
DEBUGP(DSLHC, "slhc_compress(): Delta-list length (deltaS) = %ld\n", deltaS);
DEBUGP(DSLHC, "slhc_compress(): Original header len (hlen) = %d\n", hlen);
memcpy(cp,new_seq,deltaS); /* Write list of deltas */
memcpy(cp+deltaS,icp+hlen,isize-hlen);

View File

@@ -209,12 +209,12 @@ static void test_slhc(const void *ctx)
packet_len = DISP_MAX_BYTES;
if (packet_decompr_len > DISP_MAX_BYTES)
packet_decompr_len = DISP_MAX_BYTES;
printf("Original Packet: (%i bytes) %s\n", packet_len,
printf("Original Packet: (%d bytes) %s\n", packet_len,
osmo_hexdump_nospc(packet, packet_len));
printf("DecompressedPacket: (%i bytes) %s\n",
printf("DecompressedPacket: (%d bytes) %s\n",
packet_decompr_len, osmo_hexdump_nospc(packet_decompr,
packet_decompr_len));
printf("CompressedPacket: (%i bytes) %s\n", packet_compr_len,
printf("CompressedPacket: (%d bytes) %s\n", packet_compr_len,
osmo_hexdump_nospc(packet_compr, packet_compr_len));
slhc_o_status(comp);
slhc_o_status(comp);

View File

@@ -55,7 +55,7 @@ static void test_xid_decode_realworld(const void *ctx)
/* Encode comp-fields again */
rc = gprs_sndcp_compile_xid(xid_r,sizeof(xid_r), comp_fields,
DEFAULT_SNDCP_VERSION);
printf("Result length=%i\n",rc);
printf("Result length=%d\n", rc);
printf("Encoded: %s\n", osmo_hexdump_nospc(xid, sizeof(xid)));
printf("Rencoded: %s\n", osmo_hexdump_nospc(xid_r, rc));
@@ -231,7 +231,7 @@ static void test_xid_encode_decode(const void *ctx)
DEFAULT_SNDCP_VERSION);
OSMO_ASSERT(rc > 0);
printf("Encoded: %s (%i bytes)\n", osmo_hexdump_nospc(xid, rc), rc);
printf("Encoded: %s (%d bytes)\n", osmo_hexdump_nospc(xid, rc), rc);
/* Parse and show contained comp fields */
comp_fields_dec = gprs_sndcp_parse_xid(NULL, ctx, xid, rc, NULL);

View File

@@ -268,7 +268,7 @@ static void v42bis(const void *ctx, int mode, uint8_t *testvec, int len)
rc_sum += rc;
/* Check results */
printf("Mode: %i\n", mode);
printf("Mode: %d\n", mode);
printf("uncompressed_original= %s ASCII:",
osmo_hexdump_nospc(uncompressed_original, len));
@@ -314,7 +314,7 @@ static void test_v42bis_tcpip(const void *ctx, int packet_id)
int len;
printf
("Testing compression/decompression with realistic TCP/IP packets:\n");
printf("Packet No.: %i\n", packet_id);
printf("Packet No.: %d\n", packet_id);
len = strlen(uncompr_packets[packet_id]);
testvec = talloc_zero_size(ctx, len);
len = osmo_hexparse(uncompr_packets[packet_id], testvec, len);
@@ -339,7 +339,7 @@ static void test_v42bis_tcpip_decompress(const void *ctx, int packet_id)
printf
("Testing decompression with sniffed compressed TCP/IP packets:\n");
printf("Packet No.: %i\n", packet_id);
printf("Packet No.: %d\n", packet_id);
len = strlen(compr_packets[packet_id]);
uncompressed = talloc_zero_size(ctx, len);

View File

@@ -73,8 +73,8 @@ static void test_xid_encode(const void *ctx)
/* Encode data */
rc = gprs_llc_compile_xid(xid, sizeof(xid), &xid_fields);
OSMO_ASSERT(rc == 14);
printf("Encoded: %s (%i bytes)\n", osmo_hexdump_nospc(xid, rc), rc);
printf("Expected: %s (%i bytes)\n",
printf("Encoded: %s (%d bytes)\n", osmo_hexdump_nospc(xid, rc), rc);
printf("Expected: %s (%d bytes)\n",
osmo_hexdump_nospc(xid_expected, sizeof(xid_expected)),
(int)sizeof(xid_expected));
@@ -112,7 +112,7 @@ static void test_xid_decode(const void *ctx)
/* Encode xid-fields again */
rc = gprs_llc_compile_xid(xid_r, sizeof(xid_r), xid_fields);
printf("Result length=%i\n",rc);
printf("Result length=%d\n", rc);
printf("Encoded: %s\n", osmo_hexdump_nospc(xid, sizeof(xid)));
printf("Rencoded: %s\n", osmo_hexdump_nospc(xid_r, rc));