[syslinux:elflink] ldlinux: Match arg types to function prototypes

syslinux-bot for Matt Fleming matt.fleming at intel.com
Tue Apr 17 11:24:13 PDT 2012


Commit-ID:  f1be23e2251520c35f8581f4612f2356ef6de0ee
Gitweb:     http://www.syslinux.org/commit/f1be23e2251520c35f8581f4612f2356ef6de0ee
Author:     Matt Fleming <matt.fleming at intel.com>
AuthorDate: Mon, 2 Apr 2012 13:36:17 +0100
Committer:  Matt Fleming <matt.fleming at intel.com>
CommitDate: Tue, 17 Apr 2012 10:58:33 +0100

ldlinux: Match arg types to function prototypes

Change the types of some local variables to match the type in the
function prototypes, thereby avoiding the following warnings,

ldlinux.c:132:2: warning: pointer targets in passing argument 2 of ‘syslinux_getadv’ differ in signedness
../../../com32/include/syslinux/adv.h:55:22: note: expected ‘size_t *’ but argument is of type ‘int *’
ldlinux.c:132:6: warning: assignment discards qualifiers from pointer target type
ldlinux.c:156:3: warning: pointer targets in passing argument 1 of ‘load_kernel’ differ in signedness
ldlinux.c:58:13: note: expected ‘const char *’ but argument is of type ‘uint8_t *’

Signed-off-by: Matt Fleming <matt.fleming at intel.com>

---
 com32/elflink/ldlinux/ldlinux.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/com32/elflink/ldlinux/ldlinux.c b/com32/elflink/ldlinux/ldlinux.c
index 3cf6513..55886be 100644
--- a/com32/elflink/ldlinux/ldlinux.c
+++ b/com32/elflink/ldlinux/ldlinux.c
@@ -117,8 +117,8 @@ static void enter_cmdline(void)
 int main(int argc, char **argv)
 {
 	com32sys_t ireg, oreg;
-	uint8_t *adv;
-	int count = 0;
+	const void *adv;
+	size_t count = 0;
 	char *config_argv[2] = { NULL, NULL };
 
 	openconsole(&dev_rawcon_r, &dev_ansiserial_w);
@@ -134,10 +134,11 @@ int main(int argc, char **argv)
 		 * We apparently have a boot-once set; clear it and
 		 * then execute the boot-once.
 		 */
-		uint8_t *src, *dst, *cmdline;
-		int i;
+		const char *cmdline;
+		char *src, *dst;
+		size_t i;
 
-		src = adv;
+		src = (char *)adv;
 		cmdline = dst = malloc(count + 1);
 		if (!dst) {
 			printf("Failed to allocate memory for ADV\n");


More information about the Syslinux-commits mailing list