Merge branch 'V5-4-patches' into V5-5-patches

* V5-4-patches:
  Remove C99 length specifier 'z' and use a cast instead
diff --git a/agent/kernel.c b/agent/kernel.c
index 82e4af6..bc476da 100644
--- a/agent/kernel.c
+++ b/agent/kernel.c
@@ -89,16 +89,17 @@
 klookup(unsigned long off, void *target, size_t siz)
 {
     int             result;
+
     if (kd == NULL)
         return 0;
     result = kvm_read(kd, off, target, siz);
     if (result != siz) {
 #if HAVE_KVM_OPENFILES
-        snmp_log(LOG_ERR, "kvm_read(*, %lx, %p, %zx) = %d: %s\n", off,
-                 target, siz, result, kvm_geterr(kd));
+        snmp_log(LOG_ERR, "kvm_read(*, %lx, %p, %x) = %d: %s\n", off,
+                 target, (unsigned) siz, result, kvm_geterr(kd));
 #else
         snmp_log(LOG_ERR, "kvm_read(*, %lx, %p, %d) = %d: ", off, target,
-                 siz, result);
+                 (unsigned) siz, result);
         snmp_log_perror("klookup");
 #endif
         return 0;
@@ -191,7 +192,7 @@
         return 0;
 
     if ((retsiz = klseek((off_t) off)) != off) {
-        snmp_log(LOG_ERR, "klookup(%lx, %p, %zd): ", off, target, siz);
+        snmp_log(LOG_ERR, "klookup(%lx, %p, %d): ", off, target, (int) siz);
         snmp_log_perror("klseek");
         return (0);
     }
@@ -201,12 +202,13 @@
              * these happen too often on too many architectures to print them
              * unless we're in debugging mode. People get very full log files. 
              */
-            snmp_log(LOG_ERR, "klookup(%lx, %p, %zd): ", off, target, siz);
+            snmp_log(LOG_ERR, "klookup(%lx, %p, %d): ", off, target, (int) siz);
             snmp_log_perror("klread");
         }
         return (0);
     }
-    DEBUGMSGTL(("verbose:kernel:klookup", "klookup(%lx, %p, %zd) succeeded", off, target, siz));
+    DEBUGMSGTL(("verbose:kernel:klookup", "klookup(%lx, %p, %d) succeeded",
+                off, target, (int) siz));
     return (1);
 }
 
diff --git a/agent/mibgroup/host/data_access/swrun_procinfo.c b/agent/mibgroup/host/data_access/swrun_procinfo.c
index 6f22a7b..14640e1 100644
--- a/agent/mibgroup/host/data_access/swrun_procinfo.c
+++ b/agent/mibgroup/host/data_access/swrun_procinfo.c
@@ -123,8 +123,8 @@
     }
     free(proc_table);
 
-    DEBUGMSGTL(("swrun:load:arch"," loaded %zd entries\n",
-                CONTAINER_SIZE(container)));
+    DEBUGMSGTL(("swrun:load:arch"," loaded %d entries\n",
+                (int) CONTAINER_SIZE(container)));
 
     return 0;
 }
diff --git a/agent/mibgroup/if-mib/data_access/interface_sysctl.c b/agent/mibgroup/if-mib/data_access/interface_sysctl.c
index 054eb0a..06cfefe 100644
--- a/agent/mibgroup/if-mib/data_access/interface_sysctl.c
+++ b/agent/mibgroup/if-mib/data_access/interface_sysctl.c
@@ -352,11 +352,12 @@
     if_list = malloc(if_list_size);
     if (if_list == NULL) {
         snmp_log(LOG_ERR, "could not allocate memory for interface info "
-                 "(%zu bytes)\n", if_list_size);
+                 "(%u bytes)\n", (unsigned) if_list_size);
         return -3;
     } else {
         DEBUGMSGTL(("access:interface:container:sysctl",
-                    "allocated %zu bytes for if_list\n", if_list_size));
+                    "allocated %u bytes for if_list\n",
+                    (unsigned) if_list_size));
     }
 
     if (sysctl(sysctl_oid, sizeof(sysctl_oid)/sizeof(int), if_list,