diff options
author | Flavio Cruz <flaviocruz@gmail.com> | 2016-04-03 02:27:23 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2016-04-03 10:58:39 +0200 |
commit | 2fdebbcabc5416c8b4e895c4a439748050ff1259 (patch) | |
tree | 9bac1d474fd11993299503d9caa92862328ab6d8 /user.c | |
parent | 7f10b4ed6a557b7a1fd1083939156a3dcf8b377e (diff) | |
download | mig-2fdebbcabc5416c8b4e895c4a439748050ff1259.tar.gz mig-2fdebbcabc5416c8b4e895c4a439748050ff1259.tar.bz2 mig-2fdebbcabc5416c8b4e895c4a439748050ff1259.zip |
Use word_size instead of 4.
* server.c: Use word_size and update comments.
* type.c: Use word_size to compute padding.
* user.c: Use word_size and update comments.
Diffstat (limited to 'user.c')
-rw-r--r-- | user.c | 22 |
1 files changed, 11 insertions, 11 deletions
@@ -497,7 +497,7 @@ WriteArgSize(FILE *file, const argument_t *arg) fprintf(file, "(InP->%s%s.msgt_inline) ? ", arg->argTTName, arg->argLongForm ? ".msgtl_header" : ""); } - if (bsize % 4 != 0) + if (bsize % word_size != 0) fprintf(file, "("); if (bsize > 1) @@ -513,11 +513,11 @@ WriteArgSize(FILE *file, const argument_t *arg) count->argVarName); /* - * If the base type size is not a multiple of sizeof(int) [4], + * If the base type size is not a multiple of word_size, * we have to round up. */ - if (bsize % 4 != 0) - fprintf(file, " + 3) & ~3"); + if (bsize % word_size != 0) + fprintf(file, " + %d) & ~%d", word_size - 1, word_size - 1); if (ptype->itIndefinite) { fprintf(file, " : sizeof(%s *)", @@ -821,7 +821,7 @@ WriteCheckArgSize(FILE *file, const argument_t *arg) arg->argTTName, arg->argLongForm ? ".msgtl_header" : ""); } - if (btype->itTypeSize % 4 != 0) + if (btype->itTypeSize % word_size != 0) fprintf(file, "("); if (multiplier > 1) @@ -829,10 +829,10 @@ WriteCheckArgSize(FILE *file, const argument_t *arg) fprintf(file, "OutP->%s", count->argMsgField); - /* If the base type size of the data field isn`t a multiple of 4, + /* If the base type size of the data field isn`t a multiple of word_size, we have to round up. */ - if (btype->itTypeSize % 4 != 0) - fprintf(file, " + 3) & ~3"); + if (btype->itTypeSize % word_size != 0) + fprintf(file, " + %d) & ~%d", word_size - 1, word_size - 1); if (ptype->itIndefinite) fprintf(file, " : sizeof(%s *)", FetchUserType(btype)); @@ -867,8 +867,8 @@ WriteCheckMsgSize(FILE *file, const argument_t *arg) boolean_t LastVarArg = arg->argReplyPos+1 == rt->rtNumReplyVar; /* calculate the actual size in bytes of the data field. note - that this quantity must be a multiple of four. hence, if - the base type size isn't a multiple of four, we have to + that this quantity must be a multiple of word_size. hence, if + the base type size isn't a multiple of word_size, we have to round up. note also that btype->itNumber must divide btype->itTypeSize (see itCalculateSizeInfo). */ @@ -1116,7 +1116,7 @@ WriteReturnValue(FILE *file, const routine_t *rt) /************************************************************* * Writes the elements of the message type declaration: the * msg_type structure, the argument itself and any padding - * that is required to make the argument a multiple of 4 bytes. + * that is required to make the argument a multiple of word_size bytes. * Called by WriteRoutine for all the arguments in the request * message first and then the reply message. *************************************************************/ |