]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Use %llx not %lx for uint64_t
authorMatt Caswell <matt@openssl.org>
Fri, 30 Jun 2023 15:40:41 +0000 (16:40 +0100)
committerPauli <pauli@openssl.org>
Thu, 6 Jul 2023 02:55:21 +0000 (12:55 +1000)
Some compilers don't like %lx

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21332)

ssl/quic/quic_trace.c
test/quic_cc_test.c
test/quic_multistream_test.c

index 34ee65ad953ea8ff62e6cf965fa79c7a0ecacea9..ed25e05ee3504792d63f7b24a3556d5f58476e61 100644 (file)
@@ -355,7 +355,7 @@ static int frame_path_challenge(BIO *bio, PACKET *pkt)
     if (!ossl_quic_wire_decode_frame_path_challenge(pkt, &data))
         return 0;
 
-    BIO_printf(bio, "    Data: %016lx\n", data);
+    BIO_printf(bio, "    Data: %016llx\n", (unsigned long long)data);
 
     return 1;
 }
@@ -367,7 +367,7 @@ static int frame_path_response(BIO *bio, PACKET *pkt)
     if (!ossl_quic_wire_decode_frame_path_response(pkt, &data))
         return 0;
 
-    BIO_printf(bio, "    Data: %016lx\n", data);
+    BIO_printf(bio, "    Data: %016llx\n", (unsigned long long)data);
 
     return 1;
 }
@@ -588,7 +588,8 @@ int ossl_quic_trace(int write_p, int version, int content_type,
             BIO_puts(bio, " Packet\n");
             BIO_printf(bio, "  Packet Type: %s\n", packet_type(hdr.type));
             if (hdr.type != QUIC_PKT_TYPE_1RTT)
-                BIO_printf(bio, "  Version: 0x%08x\n", hdr.version);
+                BIO_printf(bio, "  Version: 0x%08lx\n",
+                           (unsigned long)hdr.version);
             BIO_puts(bio, "  Destination Conn Id: ");
             put_conn_id(bio, &hdr.dst_conn_id);
             BIO_puts(bio, "\n");
index a6b45e3ed6d796f7c428db402e281c7a17f1eb90..67ab38f28a70dafbdd34484b1809443e8adf0469 100644 (file)
@@ -444,8 +444,10 @@ static int test_simulate(void)
 
         double error = ((double)estimated_capacity / (double)actual_capacity) - 1.0;
 
-        TEST_info("est = %6lu kB/s, act=%6lu kB/s (error=%.02f%%)\n",
-                  estimated_capacity, actual_capacity, error * 100.0);
+        TEST_info("est = %6llu kB/s, act=%6llu kB/s (error=%.02f%%)\n",
+                  (unsigned long long)estimated_capacity,
+                  (unsigned long long)actual_capacity,
+                  error * 100.0);
 
         /* Max 5% error */
         if (!TEST_double_le(error, 0.05))
index 128d169f7620c40593cb085a067d0a03607f2515..7091266c115af912305e8c000aabb3f29db62990 100644 (file)
@@ -747,7 +747,8 @@ static int run_script_worker(struct helper *h, const struct script_op *script,
                     break;
 
                 default:
-                    TEST_error("opcode %d not allowed on child thread", op->op);
+                    TEST_error("opcode %lu not allowed on child thread",
+                               (unsigned long)op->op);
                     goto out;
             }
         }