aboutsummaryrefslogtreecommitdiff
path: root/user.c
diff options
context:
space:
mode:
authorFlavio Cruz <flaviocruz@gmail.com>2016-03-15 05:31:41 -0400
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2016-03-20 00:21:02 +0100
commit7f10b4ed6a557b7a1fd1083939156a3dcf8b377e (patch)
tree9067ea000d67fd1622c1ef6160205b7154e9260d /user.c
parent90963b533e0e8c1dccfcf79afe55d6b0a9c55d79 (diff)
downloadmig-7f10b4ed6a557b7a1fd1083939156a3dcf8b377e.tar.gz
mig-7f10b4ed6a557b7a1fd1083939156a3dcf8b377e.tar.bz2
mig-7f10b4ed6a557b7a1fd1083939156a3dcf8b377e.zip
Remove functions, procedures and simple procedures.
This has been tested by cross-compiling a base Hurd system to make sure these kinds of routines are no longer used. * lexxer.l: Remove tokens. * parser.y: Remove token types and production rules. * routine.c: Remove rtMakeProcedure, rtMakeSimpleProcedure, rtMakeFunction. * routine.h: Remove enum values rkSimpleProcedure, rkProcedure, rkFunction. Remove dead fields from struct routine. * user.c: Simplify and remove dead code.
Diffstat (limited to 'user.c')
-rw-r--r--user.c32
1 files changed, 8 insertions, 24 deletions
diff --git a/user.c b/user.c
index 1f3ba3d..66859f0 100644
--- a/user.c
+++ b/user.c
@@ -213,7 +213,7 @@ WriteVarDecls(FILE *file, const routine_t *rt)
fprintf(file, "\tReply *OutP = &Mess.Out;\n");
fprintf(file, "\n");
- if (!rt->rtOneWay || rt->rtProcedure)
+ if (!rt->rtOneWay)
fprintf(file, "\tmach_msg_return_t msg_result;\n");
if (!rt->rtSimpleFixedRequest)
@@ -252,11 +252,9 @@ WriteVarDecls(FILE *file, const routine_t *rt)
static void
WriteMsgError(FILE *file, const routine_t *rt, const char *error_msg)
{
- if (rt->rtProcedure)
- fprintf(file, "\t\t{ %s(%s); return; }\n", rt->rtErrorName, error_msg);
- else if (rt->rtReturn != rt->rtRetCode)
+ if (rt->rtReturn != rt->rtRetCode)
{
- fprintf(file, "\t\t{ %s(%s); ", rt->rtErrorName, error_msg);
+ fprintf(file, "\t\t{ (%s); ", error_msg);
if (rt->rtNumReplyVar > 0)
fprintf(file, "OutP = &Mess.Out; ");
fprintf(file, "return OutP->%s; }\n", rt->rtReturn->argMsgField);
@@ -267,16 +265,12 @@ WriteMsgError(FILE *file, const routine_t *rt, const char *error_msg)
/*************************************************************
* Writes the send call when there is to be no subsequent
- * receive. Called by WriteRoutine for SimpleProcedures
- * or SimpleRoutines
+ * receive. Called by WriteRoutine for SimpleRoutines.
*************************************************************/
static void
WriteMsgSend(FILE *file, const routine_t *rt)
{
- const char *MsgResult = (rt->rtProcedure)
- ? "msg_result ="
- : "return";
-
+ const char *MsgResult = "return";
char SendSize[24];
if (rt->rtNumRequestVar == 0)
@@ -301,12 +295,6 @@ WriteMsgSend(FILE *file, const routine_t *rt)
" MACH_PORT_NULL, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL);\n"
);
}
-
- if (rt->rtProcedure)
- {
- fprintf(file, "\tif (msg_result != MACH_MSG_SUCCESS)\n");
- WriteMsgError(file, rt, "msg_result");
- }
}
/*************************************************************
@@ -342,7 +330,7 @@ WriteMsgCheckReceive(FILE *file, const routine_t *rt, const char *success)
/*************************************************************
* Writes the rpc call and the code to check for errors.
* This is the default code to be generated. Called by WriteRoutine
- * for all routine types except SimpleProcedure and SimpleRoutine.
+ * for all routine types except SimpleRoutine.
*************************************************************/
static void
WriteMsgRPC(FILE *file, const routine_t *rt)
@@ -1213,12 +1201,8 @@ WriteRoutine(FILE *file, const routine_t *rt)
else {
WriteReplyArgs(file, rt);
- /* return the return value, if any */
-
- if (rt->rtProcedure)
- fprintf(file, "\t/* Procedure - no return needed */\n");
- else
- WriteReturnValue(file, rt);
+ /* return the return value */
+ WriteReturnValue(file, rt);
}
}