Skip to content

Commit 153ec39

Browse files
committed
CL: CS-1222: rename sge_uu32 to sge_u32
CL: CS-1025: remove static_cast<u_long32> for pid_t/uid_t and gid_t and correct format strings
1 parent bd55c38 commit 153ec39

File tree

133 files changed

+889
-892
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

133 files changed

+889
-892
lines changed

source/clients/common/ocs_client_job.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,13 @@ void cull_show_job(const lListElem *job, int flags, bool show_binding) {
8787

8888
if (!(flags & FLG_QALTER)) {
8989
if (lGetUlong(job, JB_job_number))
90-
printf("job_number: " sge_uu32 "\n", lGetUlong(job, JB_job_number));
90+
printf("job_number: " sge_u32 "\n", lGetUlong(job, JB_job_number));
9191
else
9292
printf("job_number: %s\n", MSG_JOB_UNASSIGNED);
9393
}
9494

9595
if (lGetPosViaElem(job, JB_category_id, SGE_NO_ABORT) >= 0)
96-
printf("category_id: " sge_uu32 "\n", lGetUlong(job, JB_category_id));
96+
printf("category_id: " sge_u32 "\n", lGetUlong(job, JB_category_id));
9797

9898
if (lGetPosViaElem(job, JB_exec_file, SGE_NO_ABORT) >= 0)
9999
if (lGetString(job, JB_exec_file))
@@ -388,7 +388,7 @@ void cull_show_job(const lListElem *job, int flags, bool show_binding) {
388388

389389
if (lGetPosViaElem(job, JB_jobshare, SGE_NO_ABORT) >= 0) {
390390
printf("jobshare: ");
391-
printf(sge_uu32 "\n", lGetUlong(job, JB_jobshare));
391+
printf(sge_u32 "\n", lGetUlong(job, JB_jobshare));
392392
}
393393

394394
if (lGetPosViaElem(job, JB_restart, SGE_NO_ABORT) >= 0)
@@ -458,7 +458,7 @@ void cull_show_job(const lListElem *job, int flags, bool show_binding) {
458458

459459
if (lGetPosViaElem(job, JB_script_size, SGE_NO_ABORT) >= 0)
460460
if (lGetUlong(job, JB_script_size))
461-
printf("script_size: " sge_uu32 "\n", lGetUlong(job, JB_script_size));
461+
printf("script_size: " sge_u32 "\n", lGetUlong(job, JB_script_size));
462462

463463
if (lGetPosViaElem(job, JB_script_file, SGE_NO_ABORT) >= 0)
464464
if (lGetString(job, JB_script_file))
@@ -582,7 +582,7 @@ void cull_show_job(const lListElem *job, int flags, bool show_binding) {
582582

583583
job_get_submit_task_ids(job, &start, &end, &step);
584584
if (job_is_array(job))
585-
printf("job-array tasks: " sge_uu32 "-" sge_uu32 ":" sge_uu32 "\n", start, end, step);
585+
printf("job-array tasks: " sge_u32 "-" sge_u32 ":" sge_u32 "\n", start, end, step);
586586
}
587587

588588
if (lGetPosViaElem(job, JB_context, SGE_NO_ABORT) >= 0)

source/clients/common/ocs_client_print.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ int sge_print_jobs_queue(lListElem *qep, lList *job_list, const lList *pe_list,
266266
jid = lGetUlong(jlep, JB_job_number);
267267
old_jataskid = jataskid;
268268
jataskid = lGetUlong(jatep, JAT_task_number);
269-
sge_dstring_sprintf(&dyn_task_str, sge_uu32, jataskid);
269+
sge_dstring_sprintf(&dyn_task_str, sge_u32, jataskid);
270270
different = (jid != old_jid) || (jataskid != old_jataskid);
271271

272272
if (different) {
@@ -499,7 +499,7 @@ static int sge_print_job(lListElem *job, lListElem *jatep, lListElem *qep, int p
499499
sge_dstring_sprintf_append(&output, " ");
500500
}
501501
} else {
502-
snprintf(jobid, sizeof(jobid) - 1, sge_uu32, lGetUlong(job, JB_job_number));
502+
snprintf(jobid, sizeof(jobid) - 1, sge_u32, lGetUlong(job, JB_job_number));
503503
ret = report_handler->report_job_begin(report_handler, cqname, jobid, alpp);
504504
if (ret != QHOST_SUCCESS) {
505505
DRETURN(ret);
@@ -984,7 +984,7 @@ static int sge_print_job(lListElem *job, lListElem *jatep, lListElem *qep, int p
984984
for_each_ep(gdil_ep, lGetList(jatep, JAT_granted_destin_identifier_list)) {
985985
pe_slots += lGetUlong(gdil_ep, JG_slots);
986986
}
987-
printf(QSTAT_INDENT "Granted PE: %s " sge_uu32 "\n", lGetString(jatep, JAT_granted_pe), pe_slots);
987+
printf(QSTAT_INDENT "Granted PE: %s " sge_u32 "\n", lGetString(jatep, JAT_granted_pe), pe_slots);
988988
}
989989
if (lGetString(job, JB_checkpoint_name))
990990
printf(QSTAT_INDENT "Checkpoint Env.: %s\n", lGetString(job, JB_checkpoint_name));
@@ -1068,7 +1068,7 @@ static int sge_print_job(lListElem *job, lListElem *jatep, lListElem *qep, int p
10681068
if (ql) {
10691069
printf(QSTAT_INDENT "Predecessor Jobs: ");
10701070
for_each_ep(qrep, ql) {
1071-
printf(sge_uu32, lGetUlong(qrep, JRE_job_number));
1071+
printf(sge_u32, lGetUlong(qrep, JRE_job_number));
10721072
printf("%s", lNext(qrep) ? ", " : "\n");
10731073
}
10741074
}
@@ -1084,7 +1084,7 @@ static int sge_print_job(lListElem *job, lListElem *jatep, lListElem *qep, int p
10841084
if (ql) {
10851085
printf(QSTAT_INDENT "Predecessor Array Jobs: ");
10861086
for_each_ep(qrep, ql) {
1087-
printf(sge_uu32, lGetUlong(qrep, JRE_job_number));
1087+
printf(sge_u32, lGetUlong(qrep, JRE_job_number));
10881088
printf("%s", lNext(qrep) ? ", " : "\n");
10891089
}
10901090
}

source/clients/qacct/ocs_qacct.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ int main(int argc, char **argv) {
251251
u_long32 gid;
252252
stringT buffer;
253253

254-
if (sscanf(argv[++ii], sge_uu32, &gid) == 1) {
254+
if (sscanf(argv[++ii], sge_u32, &gid) == 1) {
255255
if (sge_gid2group((gid_t)gid, buffer,
256256
MAX_STRING_SIZE, MAX_NIS_RETRIES) != 0) {
257257
options.group = sge_strdup(options.group, argv[ii]);
@@ -311,7 +311,7 @@ int main(int argc, char **argv) {
311311
if (argv[ii+1]) {
312312
if (*(argv[ii+1])=='-') {
313313
options.jobflag = 1;
314-
} else if (sscanf(argv[++ii], sge_uu32, &options.job_number) != 1) {
314+
} else if (sscanf(argv[++ii], sge_u32, &options.job_number) != 1) {
315315
options.job_number = 0;
316316
options.job_name = argv[ii];
317317
}
@@ -397,7 +397,7 @@ int main(int argc, char **argv) {
397397
*/
398398
else if (!strcmp("-d", argv[ii])) {
399399
if (argv[ii+1]) {
400-
if (sscanf(argv[++ii], sge_uu32, &days) != 1) {
400+
if (sscanf(argv[++ii], sge_u32, &days) != 1) {
401401
/*
402402
** problem: insufficient error reporting
403403
*/
@@ -465,7 +465,7 @@ int main(int argc, char **argv) {
465465
if (*(argv[ii+1])=='-') {
466466
options.arflag = 1;
467467
} else {
468-
if (sscanf(argv[++ii], sge_uu32, &options.ar_number) != 1) {
468+
if (sscanf(argv[++ii], sge_u32, &options.ar_number) != 1) {
469469
fprintf(stderr, "%s\n", MSG_PARSE_INVALID_AR_MUSTBEUINT);
470470
qacct_usage(stderr);
471471
DRETURN(1);

source/clients/qalter/ocs_qalter.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,7 @@ static lList *qalter_parse_job_parameter(u_long32 me_who, lList *cmdline, lList
774774
jobid != 0*/) {
775775
all_or_jidlist = JOB;
776776
(*all_jobs) = 0;
777-
DPRINTF("got job " sge_uu32 " from parsing\n", jobid);
777+
DPRINTF("got job " sge_u32 " from parsing\n", jobid);
778778
} else {
779779
if (!strcmp(lGetString(ep, ID_str), "all") || (all_or_jidlist == ALL)) {
780780
answer_list_add(&answer, MSG_ANSWER_ALLANDJOBIDSARENOTVALID,

source/clients/qconf/msg_qconf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272

7373
#define MSG_RQS_NOTFOUNDINFILE_SS _MESSAGE(5251, _("resource quota set " SFQ " not found in file " SFQ))
7474

75-
#define MSG_CAT_DOESNOTEXIST_U _MESSAGE(5252, _("Category " sge_uu32 " does not exist"))
75+
#define MSG_CAT_DOESNOTEXIST_U _MESSAGE(5252, _("Category " sge_u32 " does not exist"))
7676

7777
// clang-format on
7878

source/clients/qconf/ocs_qconf_parse.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5987,7 +5987,7 @@ show_thread_list() {
59875987
printf("%-15s %s\n", MSG_TABLE_EV_POOL, MSG_TABLE_SIZE);
59885988
printf("--------------------\n");
59895989
for_each_ep(ep, lp) {
5990-
printf("%-15s " sge_uu32 "\n", lGetString(ep, ST_name), lGetUlong(ep, ST_id));
5990+
printf("%-15s " sge_u32 "\n", lGetString(ep, ST_name), lGetUlong(ep, ST_id));
59915991
}
59925992
}
59935993
lFreeList(&alp);

source/clients/qdel/ocs_qdel.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ int main(int argc, char **argv) {
104104
goto error_exit;
105105
}
106106

107-
DPRINTF("force = " sge_uu32"\n", force);
107+
DPRINTF("force = " sge_u32"\n", force);
108108

109109
if (user_list) {
110110
lListElem *id;

source/clients/qevent/ocs_qevent.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -333,17 +333,17 @@ static void qevent_start_trigger_script(int qevent_event, const char* script_fil
333333
exit_status = status;
334334

335335
if ( WEXITSTATUS(exit_status) == 0 ) {
336-
INFO("exit status of script: " sge_uu32 "\n", WEXITSTATUS(exit_status));
336+
INFO("exit status of script: " sge_u32 "\n", WEXITSTATUS(exit_status));
337337
} else {
338-
ERROR("exit status of script: " sge_uu32 "\n", WEXITSTATUS(exit_status));
338+
ERROR("exit status of script: " sge_u32 "\n", WEXITSTATUS(exit_status));
339339
}
340340
DRETURN_VOID;
341341
} else {
342342
const char *basename = sge_basename( script_file, '/' );
343343
/* SETPGRP; */
344344
/* sge_close_all_fds(nullptr); */
345-
snprintf(buffer, sizeof(buffer), sge_uu32, jobid);
346-
snprintf(buffer2, sizeof(buffer2), sge_uu32, taskid);
345+
snprintf(buffer, sizeof(buffer), sge_u32, jobid);
346+
snprintf(buffer2, sizeof(buffer2), sge_u32, taskid);
347347
execlp(script_file, basename, event_name, buffer, buffer2, (char *) nullptr);
348348
}
349349
exit(1);

source/clients/qhost/ocs_qhost.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ static int xml_report_host_ulong_value(qhost_report_handler_t* handler, const ch
206206

207207
sge_dstring_clear((dstring*)handler->ctx);
208208
escape_string(name, (dstring*)handler->ctx);
209-
printf(" <hostvalue name='%s'>" sge_uu32 "</hostvalue>\n", sge_dstring_get_string((dstring*)handler->ctx), value);
209+
printf(" <hostvalue name='%s'>" sge_u32 "</hostvalue>\n", sge_dstring_get_string((dstring*)handler->ctx), value);
210210

211211
DRETURN(QHOST_SUCCESS);
212212
}
@@ -279,7 +279,7 @@ static int xml_report_queue_ulong_value(qhost_report_handler_t* handler, const c
279279

280280
sge_dstring_clear((dstring*)handler->ctx);
281281
escape_string(name, (dstring*)handler->ctx);
282-
printf(" name='%s'>" sge_uu32 "</queuevalue>\n", sge_dstring_get_string((dstring*)handler->ctx), value);
282+
printf(" name='%s'>" sge_u32 "</queuevalue>\n", sge_dstring_get_string((dstring*)handler->ctx), value);
283283

284284
DRETURN(QHOST_SUCCESS);
285285
}

source/clients/qhost/ocs_qhost_print.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ bool is_manager
620620
*/
621621
if (report_handler == nullptr) {
622622
char buf[80];
623-
snprintf(buf, sizeof(buf), sge_uu32"/%d/" sge_uu32 " ", qinstance_slots_reserved(qep),
623+
snprintf(buf, sizeof(buf), sge_u32"/%d/" sge_u32 " ", qinstance_slots_reserved(qep),
624624
qinstance_slots_used(qep), lGetUlong(qep, QU_job_slots));
625625
if (hide_data) {
626626
sge_dstring_sprintf_append(&buffer, "%-14s", "*/*/*");

0 commit comments

Comments
 (0)