From ba9a67d4ae967dd8c7bd4aaec49197d5569ff717 Mon Sep 17 00:00:00 2001
From: Adam Sampson <ats@offog.org>
Date: Sun, 13 Jul 2025 03:35:48 +0100
Subject: [PATCH] Use G_*_FORMAT when formatting 64-bit types

Index: src/daemon/slave.c
--- src/daemon/slave.c.orig
+++ src/daemon/slave.c
@@ -41,8 +41,9 @@ handle_slave_connection (int input, int output)
 	glibtop_send_version (glibtop_global_server, output);
 
 	while (do_read (input, cmnd, sizeof (glibtop_command))) {
-		glibtop_debug ("Slave %d received command "
-			 "%lu from client.", getpid (), cmnd->command);
+		glibtop_debug ("Slave %" G_GINT64_FORMAT " received command "
+			 "%" G_GUINT64_FORMAT " from client.",
+			 (gint64)getpid (), cmnd->command);
 
 		memset (resp, 0, sizeof (glibtop_response));
 
@@ -50,17 +51,17 @@ handle_slave_connection (int input, int output)
 
 		if (cmnd->data_size) {
 			if (cmnd->data_size >= BUFSIZ)
-				glibtop_error ("Client sent %lu bytes, "
+				glibtop_error ("Client sent %" G_GUINT64_FORMAT " bytes, "
 					       "but buffer is %lu",
 					       cmnd->data_size, (unsigned long)BUFSIZ);
 
-			glibtop_debug ("Client has %lu bytes of data.",
+			glibtop_debug ("Client has %" G_GUINT64_FORMAT " bytes of data.",
 				 cmnd->data_size);
 
 			do_read (input, parameter, cmnd->data_size);
 		} else if (cmnd->size) {
 			if (cmnd->size >= BUFSIZ)
-				glibtop_error ("Client sent %lu bytes, "
+				glibtop_error ("Client sent %" G_GUINT64_FORMAT " bytes, "
 					       "but buffer is %lu",
 					       cmnd->size, (unsigned long)BUFSIZ);
 
@@ -265,7 +266,7 @@ handle_slave_command (glibtop_command *cmnd, glibtop_r
 		break;
 #endif
 	default:
-		glibtop_error ("Child received unknown command %lu",
+		glibtop_error ("Child received unknown command %" G_GUINT64_FORMAT,
 			       cmnd->command);
 		break;
 	}
