ossp-pkg/xds/xdr-decode-uint32.c 1.3 -> 1.4
--- xdr-decode-uint32.c 2001/07/23 15:33:42 1.3
+++ xdr-decode-uint32.c 2001/08/01 15:25:47 1.4
@@ -25,27 +25,20 @@
SUCH DAMAGE.
*/
-#include <assert.h>
#include "internal.h"
-int xdr_decode_uint32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args)
+int xdr_decode_uint32(xds_t* xds, void* engine_context,
+ void* buffer, size_t buffer_size, size_t* used_buffer_size,
+ va_list* args)
{
xds_uint32_t* value;
- /* Consistency checks. */
-
- assert(xds != NULL);
- assert(buffer != NULL);
- assert(args != NULL);
- if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL)
- return XDS_ERR_INVALID_ARG;
- if (buffer_size < 4)
- return XDS_ERR_UNDERFLOW;
+ xds_init_decoding_engine(4);
/* Get value and format it into the buffer. */
value = va_arg(*args, xds_uint32_t*);
- assert(value != NULL);
+ xds_check_parameter(value != NULL);
*value = ((xds_uint8_t*)buffer)[0]; *value = *value << 8;
*value += ((xds_uint8_t*)buffer)[1]; *value = *value << 8;
@@ -54,5 +47,5 @@
/* Done. */
- return 4;
+ return XDS_OK;
}
|
|