Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1172)

Unified Diff: src/shared/srpc/nacl_srpc.c

Issue 5622003: Restructure the structs/unions involved in SRPC argument passing. This will... (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: '' Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/shared/srpc/nacl_srpc.c
===================================================================
--- src/shared/srpc/nacl_srpc.c (revision 3855)
+++ src/shared/srpc/nacl_srpc.c (working copy)
@@ -35,7 +35,7 @@
outs[0] = &out_carray;
outs[1] = NULL;
out_carray.tag = NACL_SRPC_ARG_TYPE_CHAR_ARRAY;
- out_carray.u.caval.carr = NULL;
+ out_carray.arrays.carr = NULL;
/* Set up the basic service descriptor to make the service discovery call. */
tmp_service = (NaClSrpcService*) malloc(sizeof(*tmp_service));
if (NULL == tmp_service) {
@@ -49,9 +49,9 @@
outs[0] = &out_carray;
outs[1] = NULL;
out_carray.tag = NACL_SRPC_ARG_TYPE_CHAR_ARRAY;
- out_carray.u.caval.count = NACL_SRPC_MAX_SERVICE_DISCOVERY_CHARS;
- out_carray.u.caval.carr = calloc(NACL_SRPC_MAX_SERVICE_DISCOVERY_CHARS, 1);
- if (NULL == out_carray.u.caval.carr) {
+ out_carray.u.count = NACL_SRPC_MAX_SERVICE_DISCOVERY_CHARS;
+ out_carray.arrays.carr = calloc(NACL_SRPC_MAX_SERVICE_DISCOVERY_CHARS, 1);
+ if (NULL == out_carray.arrays.carr) {
goto cleanup;
}
/* Invoke service discovery, getting description string */
@@ -68,18 +68,18 @@
goto cleanup;
}
/* Build the real service from the resulting string. */
- if (!NaClSrpcServiceStringCtor(service, out_carray.u.caval.carr)) {
+ if (!NaClSrpcServiceStringCtor(service, out_carray.arrays.carr)) {
goto cleanup;
}
channel->client = service;
/* Free the service string */
- free(out_carray.u.caval.carr);
+ free(out_carray.arrays.carr);
/* Return success */
return 1;
cleanup:
free(service);
- free(out_carray.u.caval.carr);
+ free(out_carray.arrays.carr);
NaClSrpcServiceDtor(tmp_service);
free(tmp_service);
return 0;

Powered by Google App Engine
This is Rietveld 408576698