From a391c8f0eef8573fd6b99e6cd264a5f2caa539cb Mon Sep 17 00:00:00 2001 From: Flavio Cruz Date: Sun, 12 Feb 2023 17:14:23 -0500 Subject: Introduce complex_alignof to replace word_size Remove the concept of word_size since it is meaningless in some architectures. This is also done in preparation to possibly introduce 8-byte aligned messages. Message-Id: --- user.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'user.c') diff --git a/user.c b/user.c index e951ee2..de3f58c 100644 --- a/user.c +++ b/user.c @@ -507,7 +507,7 @@ WriteArgSize(FILE *file, const argument_t *arg) fprintf(file, "(InP->%s%s.msgt_inline) ? ", arg->argTTName, arg->argLongForm ? ".msgtl_header" : ""); } - if (bsize % word_size != 0) + if (bsize % complex_alignof != 0) fprintf(file, "("); if (bsize > 1) @@ -523,11 +523,11 @@ WriteArgSize(FILE *file, const argument_t *arg) count->argVarName); /* - * If the base type size is not a multiple of word_size, + * If the base type size is not a multiple of complex_alignof, * we have to round up. */ - if (bsize % word_size != 0) - fprintf(file, " + %d) & ~%d", word_size - 1, word_size - 1); + if (bsize % complex_alignof != 0) + fprintf(file, " + %d) & ~%d", complex_alignof - 1, complex_alignof - 1); if (ptype->itIndefinite) { fprintf(file, " : sizeof(%s *)", @@ -831,7 +831,7 @@ WriteCheckArgSize(FILE *file, const argument_t *arg) arg->argTTName, arg->argLongForm ? ".msgtl_header" : ""); } - if (btype->itTypeSize % word_size != 0) + if (btype->itTypeSize % complex_alignof != 0) fprintf(file, "("); if (multiplier > 1) @@ -839,10 +839,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 word_size, + /* If the base type size of the data field isn`t a multiple of complex_alignof, we have to round up. */ - if (btype->itTypeSize % word_size != 0) - fprintf(file, " + %d) & ~%d", word_size - 1, word_size - 1); + if (btype->itTypeSize % complex_alignof != 0) + fprintf(file, " + %d) & ~%d", complex_alignof - 1, complex_alignof - 1); if (ptype->itIndefinite) fprintf(file, " : sizeof(%s *)", FetchUserType(btype)); @@ -877,8 +877,8 @@ WriteCheckMsgSize(FILE *file, const argument_t *arg) bool 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 word_size. hence, if - the base type size isn't a multiple of word_size, we have to + that this quantity must be a multiple of complex_alignof. hence, if + the base type size isn't a multiple of complex_alignof, we have to round up. note also that btype->itNumber must divide btype->itTypeSize (see itCalculateSizeInfo). */ @@ -1127,7 +1127,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 word_size bytes. + * that is required to make the argument a multiple of complex_alignof bytes. * Called by WriteRoutine for all the arguments in the request * message first and then the reply message. *************************************************************/ -- cgit v1.2.3