Check-in Number:
|
4229 | |
Date: |
2001-Jul-20 13:15:39 (local)
2001-Jul-20 11:15:39 (UTC) |
User: | simons |
Branch: | |
Comment: |
Relaxed type checking a bit: strings are char*, not void*. |
Tickets: |
|
Inspections: |
|
Files: |
|
ossp-pkg/xds/xdr-decode-string.c 1.2 -> 1.3
--- xdr-decode-string.c 2001/07/20 10:56:01 1.2
+++ xdr-decode-string.c 2001/07/20 11:15:39 1.3
@@ -32,7 +32,7 @@
int xdr_decode_string(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args)
{
- void** p;
+ char** p;
size_t* p_len;
size_t padding;
@@ -47,7 +47,7 @@
/* Get pointers from the stack. */
- p = va_arg(*args, void**);
+ p = va_arg(*args, char**);
p_len = va_arg(*args, size_t*);
assert(p != NULL);
assert(p_len != NULL);
@@ -75,7 +75,7 @@
/* Allocate buffer for the data. */
- *p = malloc(*p_len + 1);
+ *p = (char*)malloc(*p_len + 1);
if (*p == NULL)
return XDS_ERR_NO_MEM;
|
|
ossp-pkg/xds/xdr-encode-string.c 1.3 -> 1.4
--- xdr-encode-string.c 2001/07/20 10:56:01 1.3
+++ xdr-encode-string.c 2001/07/20 11:15:39 1.4
@@ -32,9 +32,9 @@
int xdr_encode_string(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args)
{
- xds_uint8_t* p;
- size_t p_len;
- size_t padding;
+ char* p;
+ size_t p_len;
+ size_t padding;
/* Consistency checks. */
@@ -48,9 +48,9 @@
/* Get value from stack and calculate the correct amount of
padding. */
- p = (xds_uint8_t*)va_arg(*args, void*);
+ p = va_arg(*args, char*);
assert(p != NULL);
- p_len = strlen((char*)p);
+ p_len = strlen(p);
padding = (4 - (p_len & 0x03)) & 0x03;
assert((p_len + padding) % 4 == 0);
|
|