From 7700f0f5c0ab90bf052e33fa0ddd2f2aa7e7893e Mon Sep 17 00:00:00 2001 From: lpleahy Date: Fri, 17 Feb 2012 23:43:35 +0000 Subject: * StdLib.dsc was changed to always build the sockets code. * Fix errors detected by the GCC compiler (pointer conversions and format mismatches). * Worked around a GCC flow analysis issue in base64.c where the compiler is convinced that there is a path through the code where "input" is used but not initialized. * Added EFIAPI to the file system operation routines for sockets to match the API declaration. Note for GCC, the meaning of "l" and "L" are different in printf and sscanf format strings. The lower case "l" indicates a 32-bit value where the capital "L" indicates a 64-bit value. The native (default) integer size may be represented by a size letter of "n". Signed-off-by: lpleahy git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13023 6f19259b-4bc3-4df7-8a09-765794883524 --- StdLib/BsdSocketLib/ns_print.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'StdLib/BsdSocketLib/ns_print.c') diff --git a/StdLib/BsdSocketLib/ns_print.c b/StdLib/BsdSocketLib/ns_print.c index ff7047a1fd..a5d8ad3d7d 100644 --- a/StdLib/BsdSocketLib/ns_print.c +++ b/StdLib/BsdSocketLib/ns_print.c @@ -228,7 +228,7 @@ ns_sprintrrf(const u_char *msg, size_t msglen, /* Serial number. */ t = ns_get32(rdata); rdata += NS_INT32SZ; T(addstr("\t\t\t\t\t", 5, &buf, &buflen)); - len = SPRINTF((tmp, "%lu", t)); + len = SPRINTF((tmp, "%Lu", t)); T(addstr(tmp, len, &buf, &buflen)); T(spaced = addtab(len, 16, spaced, &buf, &buflen)); T(addstr("; serial\n", 9, &buf, &buflen)); @@ -284,7 +284,7 @@ ns_sprintrrf(const u_char *msg, size_t msglen, /* Priority. */ t = ns_get16(rdata); rdata += NS_INT16SZ; - len = SPRINTF((tmp, "%u ", t)); + len = SPRINTF((tmp, "%u ", (unsigned int)t)); T(addstr(tmp, len, &buf, &buflen)); /* Target. */ @@ -302,7 +302,7 @@ ns_sprintrrf(const u_char *msg, size_t msglen, /* Priority. */ t = ns_get16(rdata); rdata += NS_INT16SZ; - len = SPRINTF((tmp, "%u ", t)); + len = SPRINTF((tmp, "%u ", (unsigned int)t)); T(addstr(tmp, len, &buf, &buflen)); /* Name1. */ @@ -363,7 +363,7 @@ ns_sprintrrf(const u_char *msg, size_t msglen, /* Order, Precedence. */ order = ns_get16(rdata); rdata += NS_INT16SZ; preference = ns_get16(rdata); rdata += NS_INT16SZ; - len = SPRINTF((t, "%u %u ", order, preference)); + len = SPRINTF((t, "%u %u ", (unsigned int)order, (unsigned int)preference)); T(addstr(t, len, &buf, &buflen)); /* Flags. */ @@ -404,7 +404,7 @@ ns_sprintrrf(const u_char *msg, size_t msglen, priority = ns_get16(rdata); rdata += NS_INT16SZ; weight = ns_get16(rdata); rdata += NS_INT16SZ; port = ns_get16(rdata); rdata += NS_INT16SZ; - len = SPRINTF((t, "%u %u %u ", priority, weight, port)); + len = SPRINTF((t, "%u %u %u ", (unsigned int)priority, (unsigned int)weight, (unsigned int)port)); T(addstr(t, len, &buf, &buflen)); /* Server. */ @@ -477,7 +477,7 @@ ns_sprintrrf(const u_char *msg, size_t msglen, protocol = *rdata++; algorithm = *rdata++; len = SPRINTF((tmp, "0x%04x %u %u", - keyflags, protocol, algorithm)); + (unsigned int)keyflags, (unsigned int)protocol, (unsigned int)algorithm)); T(addstr(tmp, len, &buf, &buflen)); /* Public key data. */ @@ -516,8 +516,8 @@ ns_sprintrrf(const u_char *msg, size_t msglen, algorithm = *rdata++; labels = *rdata++; t = ns_get32(rdata); rdata += NS_INT32SZ; - len = SPRINTF((tmp, " %s %d %lu ", - p_type((int)type), algorithm, t)); + len = SPRINTF((tmp, " %s %d %Lu ", + p_type((int)type), (int)algorithm, t)); T(addstr(tmp, len, &buf, &buflen)); if (labels != (u_int)dn_count_labels(name)) goto formerr; @@ -534,7 +534,7 @@ ns_sprintrrf(const u_char *msg, size_t msglen, /* Signature Footprint. */ footprint = ns_get16(rdata); rdata += NS_INT16SZ; - len = SPRINTF((tmp, "%u ", footprint)); + len = SPRINTF((tmp, "%u ", (unsigned int)footprint)); T(addstr(tmp, len, &buf, &buflen)); /* Signer's name. */ -- cgit v1.2.3