From d303b92a5974d94f74606a3d7fa75743bcb53e0b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zden=C4=9Bk=20=C5=A0ustr?= Date: Tue, 4 Sep 2012 10:52:11 +0000 Subject: [PATCH] Use generated naming array instead of switch() --- org.glite.lb.client/examples/job_status.c | 33 +------------------------------ 1 file changed, 1 insertion(+), 32 deletions(-) diff --git a/org.glite.lb.client/examples/job_status.c b/org.glite.lb.client/examples/job_status.c index 16d4d45..a42b2e5 100644 --- a/org.glite.lb.client/examples/job_status.c +++ b/org.glite.lb.client/examples/job_status.c @@ -222,38 +222,7 @@ static void printstat(edg_wll_JobStat stat, int level) printf("%sjobId : %s\n", ind, j1 = edg_wlc_JobIdUnparse(stat.jobId)); free(j1); printf("%sowner : %s\n", ind, stat.owner); printf("%spayload_owner : %s\n", ind, stat.payload_owner); - switch (stat.jobtype) { - case EDG_WLL_STAT_SIMPLE: - printf("%sjobtype : SIMPLE\n", ind); - break; - case EDG_WLL_STAT_DAG: - printf("%sjobtype : DAG\n", ind); - break; - case EDG_WLL_STAT_COLLECTION: - printf("%sjobtype : COLLECTION\n", ind); - break; - case EDG_WLL_STAT_PBS: - printf("%sjobtype : PBS\n", ind); - break; - case EDG_WLL_STAT_CONDOR: - printf("%sjobtype : CONDOR\n", ind); - break; - case EDG_WLL_STAT_CREAM: - printf("%sjobtype : CREAM\n", ind); - break; - case EDG_WLL_STAT_FILE_TRANSFER: - printf("%sjobtype : FILE_TRANSFER\n", ind); - break; - case EDG_WLL_STAT_FILE_TRANSFER_COLLECTION: - printf("%sjobtype : FILE_TRANSFER_COLLECTION\n", ind); - break; - case EDG_WLL_STAT_VIRTUAL_MACHINE: - printf("%sjobtype : VIRTUAL_MACHINE\n", ind); - break; - default: - printf("%sjobtype : UNKNOWN\n", ind); - break; - } + printf("%sjobtype : %s\n", ind, edg_wll_StatusJobtypeNames[stat.jobtype]); printf("%sparent_job : %s\n", ind, j2 = edg_wlc_JobIdUnparse(stat.parent_job)); if (stat.jobtype) {; -- 1.8.2.3