#include <afsconfig.h>
#include <afs/param.h>
-RCSID
- ("$Header$");
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <limits.h>
#include <float.h>
-#include <malloc.h>
#include <assert.h>
#include "generator.h"
/* all one string */
"LIBS = $(DESTDIR)/lib/afsrxkad.lib \\\n"
"\t$(DESTDIR)/lib/afsdes.lib \\\n" "\t$(DESTDIR)/lib/afsrx.lib \\\n"
+ "\t$(DESTDIR)/lib/afshcrypto.lib \\\n"
"\t$(DESTDIR)/lib/afslwp.lib \\\n"
"\t$(DESTDIR)/lib/afs/afscmd.lib \\\n"
"\t$(DESTDIR)/lib/afs/afsafs_com_err.lib \\\n"
char *bufP2;
int i;
- bufP2 =
- (char *)calloc((MAX_TYP_STR + MAX_DIR_STR + ATTRIB_LEN * ATTRIB_NO)
+ bufP2 = calloc((MAX_TYP_STR + MAX_DIR_STR + ATTRIB_LEN * ATTRIB_NO)
* argsP->argCount + 3, sizeof(char));
MEM_CHK(bufP2, "GetDescription: out of mem bufP2\n");
/* itl file name 8.3 format */
char *bufP;
- bufP = (char *)malloc(32 * sizeof(char));
+ bufP = malloc(32 * sizeof(char));
MEM_CHK(bufP, "GetName: bufP out of mem\n");
sprintf(bufP, "%s%d", serverName, sign_no);
double d, d1;
short shI;
- *ret = (char *)calloc(MAX_RAND_LENGTH + 1, sizeof(char));
- *ret2 = (char *)calloc(MAX_RAND_LENGTH + 1, sizeof(char));
+ *ret = calloc(MAX_RAND_LENGTH + 1, sizeof(char));
+ *ret2 = calloc(MAX_RAND_LENGTH + 1, sizeof(char));
if (strstr(typ, "char")) {
GetRandStr(1, ret2, &randI);
argsP->argDescr[i].outValue[0]);
} else if (!strcmp(typ, "varString")) {
if (!strcmp(argsP->argDescr[i].direction, "OUT")) {
- fprintf(srv_h, "\n\t*a%d = (char *) malloc(STR_MAX);", i);
+ fprintf(srv_h, "\n\t*a%d = malloc(STR_MAX);", i);
}
fprintf(srv_h, "\n\tstrcpy((char *)*a%d, %s);", i,
argsP->argDescr[i].outValue[0]);
fprintf(itl_h, "}\n");
fprintf(itl_h,
- "\n\nstatic void DoRun(struct cmd_syndesc *as, char *arock) {\n");
+ "\n\nstatic void DoRun(struct cmd_syndesc *as, void *arock) {\n");
if (threadModel == PTHREADS) {
fprintf(itl_h, "\tpthread_t *tid;\n");
"malloc(numThreads*(sizeof(pthread_t)));\n");
} else {
fprintf(itl_h,
- "\ttid = (PROCESS *) malloc(numThreads*(sizeof(PROCESS *)));\n");
+ "\ttid = malloc(numThreads*(sizeof(PROCESS *)));\n");
}
fprintf(itl_h, "\tassert(tid);\n" "\tfor(j=0;j<numThreads;j++) {\n");
fprintf(itl_h,
"static void SetupRunCmd(void) {\n" "\tstruct cmd_syndesc *ts;\n"
- "\tts = cmd_CreateSyntax(NULL,DoRun, 0, \"run the test client program\");\n"
+ "\tts = cmd_CreateSyntax(NULL,DoRun, NULL, \"run the test client program\");\n"
"\tcmd_AddParm(ts, \"-threadCount\", CMD_SINGLE, CMD_REQUIRED, \"number of threads to spawn\");\n"
"\tcmd_AddParm(ts, \"-iterationCount\", CMD_SINGLE, CMD_REQUIRED, \"number of iterations to make over entire interface for each thread\");\n"
"\tcmd_AddParm(ts, \"-secType\", CMD_SINGLE, CMD_REQUIRED, \"security level to use (1 -> unauthenticated, 2 -> authenticated)\");\n"
arg->type);
fprintf(itl_h,
"\t%sa%d.drpc_out_%s_t_val = "
- "(%s *) malloc(FIX_ARRAY_SIZE * sizeof(%s));\n", s, i,
- arg->type, (arg->type + 3), (arg->type + 3));
+ "malloc(FIX_ARRAY_SIZE * sizeof(%s));\n", s, i,
+ arg->type, (arg->type + 3));
}
for (j = 0; j < IDL_FIX_ARRAY_SIZE; j++) {
if (structFlag) {
"\nstatic long GetKey (char *rock, long kvno, struct ktc_encryptionKey *key) {\n"
"\tmemcpy ((void *) key, (void *) &serviceKey, sizeof(*key));\n"
"\treturn 0;\n" "}\n\n"
- "static void DoRun(struct cmd_syndesc *as, char *arock) {\n"
+ "static void DoRun(struct cmd_syndesc *as, void *arock) {\n"
"\tstruct rx_service *serv;\n"
"\tstruct rx_securityClass *sc[3];\n\n"
"\tint port=0, errflg=0;\n" "\tint lowThreads=4, highThreads=8;\n"
"\t\trx_SetMaxProcs(serv,highThreads);\n"
"\t\trx_StartServer(1);\n" "\t}\n" "\texit(0);\n" "}\n\n"
"static void SetupRunCmd(void) {\n" "\tstruct cmd_syndesc *ts;\n"
- "\tts = cmd_CreateSyntax(NULL,DoRun, 0, \"run the test server program\");\n"
+ "\tts = cmd_CreateSyntax(NULL,DoRun, NULL, \"run the test server program\");\n"
"\tcmd_AddParm(ts, \"-lowThreadCount\", CMD_SINGLE, CMD_REQUIRED, \"minimum number of threads to spawn\");\n"
"\tcmd_AddParm(ts, \"-highThreadCount\", CMD_SINGLE, CMD_REQUIRED, \"maximum number of threads to spawn\");\n"
"\tcmd_AddParm(ts, \"-serverPort\", CMD_SINGLE, CMD_REQUIRED, \"port that server is using\");\n"