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: --- server.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'server.c') diff --git a/server.c b/server.c index 95b0056..238e958 100644 --- a/server.c +++ b/server.c @@ -483,7 +483,7 @@ WriteCheckArgSize(FILE *file, const argument_t *arg) arg->argLongForm ? ".msgtl_header" : ""); } - if (btype->itTypeSize % word_size != 0) + if (btype->itTypeSize % complex_alignof != 0) fprintf(file, "("); if (multiplier > 1) @@ -491,10 +491,10 @@ WriteCheckArgSize(FILE *file, const argument_t *arg) fprintf(file, "In%dP->%s", arg->argRequestPos, 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 *)", FetchServerType(btype)); @@ -530,8 +530,8 @@ WriteCheckMsgSize(FILE *file, const argument_t *arg) bool LastVarArg = arg->argRequestPos+1 == rt->rtNumRequestVar; /* 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). */ @@ -1090,7 +1090,7 @@ WriteArgSize(FILE *file, const argument_t *arg) arg->argLongForm ? ".msgtl_header" : ""); } - if (bsize % word_size != 0) + if (bsize % complex_alignof != 0) fprintf(file, "("); if (bsize > 1) @@ -1103,11 +1103,11 @@ WriteArgSize(FILE *file, const argument_t *arg) fprintf(file, "%s", 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 *)", -- cgit v1.2.3