Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions acinclude.m4
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ AC_CHECK_MEMBER(struct stat64.st_mode,
#include <unistd.h>])

AC_MSG_CHECKING([if largefile compiles (looking at you, OSX)])
AC_COMPILE_IFELSE([
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
Expand All @@ -197,7 +197,7 @@ int main(void) {
],[
AC_MSG_RESULT([yes])
AC_DEFINE([LARGEFILE_WORKS],1,[Define if open64, stat64, and friends work])
],[AC_MSG_RESULT([no])])
],[AC_MSG_RESULT([no])])])
])


Expand Down
3 changes: 1 addition & 2 deletions doc/soelim.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,7 @@ main(int argc, char *argv[])
return (0);
}

int dofile(filein)
FILE *filein;
int dofile(FILE *filein)
{
char buf[256];
int dirindex;
Expand Down
8 changes: 4 additions & 4 deletions src/cmds/MXML.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ int MXMLSetChild(
int MXMLCreateE(

mxml_t **E, /* O */
char *Name) /* I (optional) */
const char *Name) /* I (optional) */

{
/* NOTE: should 'Name' be mandatory? */
Expand Down Expand Up @@ -457,7 +457,7 @@ int MXMLAppendAttr(

len = strlen(E->AVal[ATok]) + strlen(AVal) + 2;

tmpAVal = realloc(E->AVal[ATok], len);
tmpAVal = (char *)realloc(E->AVal[ATok], len);

if (tmpAVal == NULL)
{
Expand Down Expand Up @@ -527,7 +527,7 @@ int MXMLSetVal(
ptr = (char *)V;
Vlen = strlen(ptr);

outbuf = calloc(buf_size, (sizeof(char)));
outbuf = (char *)calloc(buf_size, (sizeof(char)));

if (outbuf == NULL)
{
Expand Down Expand Up @@ -751,7 +751,7 @@ int MXMLToXString(
{
NewSize = MMAX_BUFFER;

if ((*Buf = calloc(1, NewSize)) == NULL)
if ((*Buf = (char *)calloc(1, NewSize)) == NULL)
{
/* cannot allocate buffer */

Expand Down
2 changes: 1 addition & 1 deletion src/cmds/MXML.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ int MXMLExtractE(mxml_t *E, mxml_t *C, mxml_t **CP);

int MXMLSetChild(mxml_t *E, char *CName, mxml_t **CE);

int MXMLCreateE(mxml_t **E, char *Name);
int MXMLCreateE(mxml_t **E, const char *Name);

int MXMLDestroyE(mxml_t **EP);

Expand Down
2 changes: 1 addition & 1 deletion src/cmds/common_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ void calloc_or_fail(
memmgr **mm, /* memory manager */
char **dest,
int alloc_size,
char *err_msg)
const char *err_msg)

{
*dest = (char *)memmgr_calloc(mm, 1, alloc_size);
Expand Down
2 changes: 1 addition & 1 deletion src/cmds/common_cmds.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ int parse_env_line(memmgr **mm, char *one_var, char **name, char **value);

void set_env_opts(memmgr **mm, job_data **env_attr, char **envp);

void calloc_or_fail(memmgr **mm, char **dest, int alloc_size, char *err_msg);
void calloc_or_fail(memmgr **mm, char **dest, int alloc_size, const char *err_msg);

int parse_variable_list(memmgr **mm, job_data **dest_hash, job_data *user_env, int var_type, int op_type, char *the_list);

Expand Down
20 changes: 10 additions & 10 deletions src/cmds/pbsdsh.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ extern int event_count;
struct tm_errcode
{
int trc_code;
char *trc_name;
const char *trc_name;
} tm_errcode[] =

{
Expand Down Expand Up @@ -69,7 +69,7 @@ fd_set permrfsd;
int grabstdio = 0;


char *get_ecname(
const char *get_ecname(

int rc)

Expand Down Expand Up @@ -283,7 +283,7 @@ getstdout(void)
{
if (FD_ISSET(i, &rfsd))
{
if ((bytes = read(i, &buf, 1023)) > 0)
if ((bytes = read_ac_socket(i, &buf, 1023)) > 0)
{
buf[bytes] = '\0';
fprintf(stdout, "%s", buf);
Expand Down Expand Up @@ -504,9 +504,9 @@ char *gethostnames(
char *hoststart;
int rc, tm_errno, i, j;

allnodes = calloc(numnodes, PBS_MAXNODENAME + 1 + sizeof(char));
rescinfo = calloc(numnodes, RESCSTRLEN + 1 + sizeof(char));
rescevent = calloc(numnodes, sizeof(tm_event_t));
allnodes = (char *)calloc(numnodes, PBS_MAXNODENAME + 1 + sizeof(char));
rescinfo = (char *)calloc(numnodes, RESCSTRLEN + 1 + sizeof(char));
rescevent = (tm_event_t*)calloc(numnodes, sizeof(tm_event_t));

if (!allnodes || !rescinfo || !rescevent)
{
Expand Down Expand Up @@ -711,7 +711,7 @@ int main(
int posixly_correct_set_by_caller = 0;
char *envstr;

id = calloc(60, sizeof(char));
id = (char *)calloc(60, sizeof(char));

if (id == NULL)
{
Expand Down Expand Up @@ -830,7 +830,7 @@ int main(
#ifdef __GNUC__
if (!posixly_correct_set_by_caller)
{
putenv("POSIXLY_CORRECT");
putenv((char *)"POSIXLY_CORRECT");
free(envstr);
}

Expand Down Expand Up @@ -991,7 +991,7 @@ int main(
stop = numnodes;
}

if ((ioenv = calloc(2, sizeof(char **))) == NULL)
if ((ioenv = (char **)calloc(2, sizeof(char **))) == NULL)
{
/* FAILURE - cannot alloc memory */

Expand All @@ -1005,7 +1005,7 @@ int main(
{
stdoutfd = build_listener(&stdoutport);

if ((*ioenv = calloc(50, sizeof(char *))) == NULL)
if ((*ioenv = (char *)calloc(50, sizeof(char *))) == NULL)
{
/* FAILURE - cannot alloc memory */

Expand Down
24 changes: 12 additions & 12 deletions src/cmds/pbsnodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ static int set_note(
int rc;
int local_errno = 0;

new_attr.name = ATTR_NODE_note;
new_attr.name = (char *)ATTR_NODE_note;
new_attr.resource = NULL;
new_attr.value = msg;
new_attr.op = SET;
Expand Down Expand Up @@ -234,7 +234,7 @@ static char *get_nstate(
}
}

return("");
return((char *)"");
}


Expand Down Expand Up @@ -265,10 +265,10 @@ static char *get_note(
static int marknode(

int con,
char *name,
char *state1,
const char *name,
const char *state1,
enum batch_op op1,
char *state2,
const char *state2,
enum batch_op op2)

{
Expand All @@ -278,9 +278,9 @@ static int marknode(
int rc;
int local_errno = 0;

new_attr[0].name = ATTR_NODE_state;
new_attr[0].name = (char *)ATTR_NODE_state;
new_attr[0].resource = NULL;
new_attr[0].value = state1;
new_attr[0].value = (char *)state1;
new_attr[0].op = op1;

if (state2 == NULL)
Expand All @@ -291,17 +291,17 @@ static int marknode(
{
new_attr[0].next = &new_attr[1];
new_attr[1].next = NULL;
new_attr[1].name = ATTR_NODE_state;
new_attr[1].name = (char *)ATTR_NODE_state;
new_attr[1].resource = NULL;
new_attr[1].value = state2;
new_attr[1].value = (char *)state2;
new_attr[1].op = op2;
}

rc = pbs_manager_err(
con,
MGR_CMD_SET,
MGR_OBJ_NODE,
name,
(char *)name,
new_attr,
NULL,
&local_errno);
Expand Down Expand Up @@ -796,7 +796,7 @@ int main(
{
if (!strcasecmp(NState[lindex], argv[optind]))
{
ListType = lindex;
ListType = (enum NStateEnum)lindex;

optind++;

Expand All @@ -814,7 +814,7 @@ int main(
}
else
{
nodeargs = calloc(2, sizeof(char **));
nodeargs = (char **)calloc(2, sizeof(char **));
nodeargs[0] = strdup("");
nodeargs[1] = '\0';
}
Expand Down
26 changes: 13 additions & 13 deletions src/cmds/pbspoe.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#define XPDBX_PATH "/usr/lpp/ppe.poe/bin/xpdbx"
#define INTERACTIVE_FILE "/usr/local/pbs/etc/interactive"

void set_if_undefined(char *name, char *val);
void set_if_undefined(const char *name, const char *val);
void check_environment();
int is_pbs_job();
char **pbs_setup(char *command, int argc, char **argv);
Expand Down Expand Up @@ -68,15 +68,15 @@ is_pbs_job(void)
return(1);
}

void set_if_undefined(char *name, char *val)
void set_if_undefined(const char *name, const char *val)
{
char *ret;
int result;
ret = getenv(name);

if (ret != NULL) return;

result = putenv(val);
result = putenv((char *)val);

if (result != 0)
{
Expand Down Expand Up @@ -272,7 +272,7 @@ char **pbs_setup(

/* make an argument list */

newargs = calloc((argc + 8), sizeof(char *));
newargs = (char **)calloc((argc + 8), sizeof(char *));

if (newargs == NULL)
{
Expand Down Expand Up @@ -351,7 +351,7 @@ char **pbs_setup(

if (ocmdfile == 0)
{
newargs[j++] = PBSPD;
newargs[j++] = (char *)PBSPD;
newargs[j++] = pbsjobkey;
}

Expand Down Expand Up @@ -422,7 +422,7 @@ char **pbs_setup(
exit(1);
}

newargs[j++] = "-cmdfile";
newargs[j++] = (char *)"-cmdfile";

newargs[j++] = ncmdfname;

Expand All @@ -432,7 +432,7 @@ char **pbs_setup(
{
fprintf(stderr, "%s: Warning, (number of host nodes) < (number of procs)\n\t-- assigning multiple processes per node\n\t-- not using high-performance switch mode\n", mcn);

putenv("MP_EUILIB=ip");
putenv((char *)"MP_EUILIB=ip");

sprintf(hostfile, "/tmp/pbsHtemp.%s", getenv("PBS_JOBID"));

Expand Down Expand Up @@ -526,7 +526,7 @@ char **pbs_setup(

free(hfile_mem);

newargs[j++] = "-hostfile";
newargs[j++] = (char *)"-hostfile";

newargs[j++] = hostfile;

Expand Down Expand Up @@ -644,15 +644,15 @@ char *get_real_command(
else
command_name = argv0;

if (!strcmp(command_name, "poe")) return(POE_PATH);
if (!strcmp(command_name, (char *)"poe")) return(POE_PATH);

if (!strcmp(command_name, "pbspoe")) return(POE_PATH);
if (!strcmp(command_name, (char *)"pbspoe")) return(POE_PATH);

if (!strcmp(command_name, "pdbx")) return(PDBX_PATH);
if (!strcmp(command_name, (char *)"pdbx")) return(PDBX_PATH);

if (!strcmp(command_name, "xpdbx")) return XPDBX_PATH;
if (!strcmp(command_name, (char *)"xpdbx")) return XPDBX_PATH;

if (!strcmp(command_name, "newpoe")) return(POE_PATH);
if (!strcmp(command_name, (char *)"newpoe")) return(POE_PATH);

fprintf(stderr, "\"%s\" unknown to the PBS front end.\n", argv0);

Expand Down
6 changes: 3 additions & 3 deletions src/cmds/qalter.c
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ int main(
if (strcmp(keyword, ATTR_depend) == 0)
{
int rtn = 0;
pdepend = calloc(1, PBS_DEPEND_LEN);
pdepend = (char *)calloc(1, PBS_DEPEND_LEN);

if ((pdepend == NULL) ||
(rtn = parse_depend_list(valuewd,pdepend,PBS_DEPEND_LEN)))
Expand Down Expand Up @@ -684,7 +684,7 @@ int main(
if ((stat != 0) &&
(any_failed != PBSE_UNKJOBID))
{
prt_job_err("qalter", connect, job_id_out);
prt_job_err((char *)"qalter", connect, job_id_out);
}
else if ((stat != 0) &&
(any_failed != PBSE_UNKJOBID) &&
Expand All @@ -701,7 +701,7 @@ int main(
goto cnt;
}

prt_job_err("qalter", connect, job_id_out);
prt_job_err((char *)"qalter", connect, job_id_out);
} /* END else if (stat && ...) */

pbs_disconnect(connect);
Expand Down
6 changes: 3 additions & 3 deletions src/cmds/qdel.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ int main(
for (;optind < argc;optind++)
{
int connect;
int stat = 0;
int stat;

/* check to see if user specified 'all' to delete all jobs */

Expand Down Expand Up @@ -247,7 +247,7 @@ int main(
if (stat &&
(any_failed != PBSE_UNKJOBID))
{
prt_job_err("qdel", connect, job_id_out);
prt_job_err((char *)"qdel", connect, job_id_out);
}
else if (stat &&
(any_failed != PBSE_UNKJOBID) &&
Expand All @@ -264,7 +264,7 @@ int main(
goto cnt;
}

prt_job_err("qdel", connect, job_id_out);
prt_job_err((char *)"qdel", connect, job_id_out);
}

pbs_disconnect(connect);
Expand Down
Loading