[Opendnssec-commits] [svn.opendnssec.org/svn/dnssec] r5430 - in branches/OpenDNSSEC-enforcer-ng/enforcer-ng/src: . daemon parser scheduler shared

Rickard Bellgrim rickard at opendnssec.org
Mon Aug 22 10:59:02 CEST 2011


Author: rb
Date: 2011-08-22 10:59:02 +0200 (Mon, 22 Aug 2011)
New Revision: 5430

Modified:
   branches/OpenDNSSEC-enforcer-ng/enforcer-ng/src/daemon/cmdhandler.c
   branches/OpenDNSSEC-enforcer-ng/enforcer-ng/src/daemon/engine.c
   branches/OpenDNSSEC-enforcer-ng/enforcer-ng/src/daemon/worker.c
   branches/OpenDNSSEC-enforcer-ng/enforcer-ng/src/ods-enforcer.c
   branches/OpenDNSSEC-enforcer-ng/enforcer-ng/src/parser/confparser.c
   branches/OpenDNSSEC-enforcer-ng/enforcer-ng/src/scheduler/task.c
   branches/OpenDNSSEC-enforcer-ng/enforcer-ng/src/shared/allocator.c
   branches/OpenDNSSEC-enforcer-ng/enforcer-ng/src/shared/str.c
Log:
Fix build warnings


Modified: branches/OpenDNSSEC-enforcer-ng/enforcer-ng/src/daemon/cmdhandler.c
===================================================================
--- branches/OpenDNSSEC-enforcer-ng/enforcer-ng/src/daemon/cmdhandler.c	2011-08-19 12:51:10 UTC (rev 5429)
+++ branches/OpenDNSSEC-enforcer-ng/enforcer-ng/src/daemon/cmdhandler.c	2011-08-22 08:59:02 UTC (rev 5430)
@@ -79,7 +79,7 @@
                       ssize_t n)
 {
     char* strtime = NULL;
-    char ctimebuf[32]; // at least 26 according to docs
+    char ctimebuf[32]; /* at least 26 according to docs */
     char buf[ODS_SE_MAXLINE];
     size_t i = 0;
     time_t now = 0;
@@ -132,13 +132,10 @@
 {
     int bShouldLeap = 0;
     char* strtime = NULL;
-    char ctimebuf[32]; // at least 26 according to docs
+    char ctimebuf[32]; /* at least 26 according to docs */
     char buf[ODS_SE_MAXLINE];
-    size_t i = 0;
     time_t now = time_now();
-    ldns_rbnode_t* node = LDNS_RBTREE_NULL;
     task_type* task = NULL;
-    char* strtask = NULL;
     const char *scmd = "time leap";
     ssize_t ncmd = strlen(scmd);
     
@@ -257,8 +254,6 @@
                       ssize_t n)
 {
     char buf[ODS_SE_MAXLINE];
-    task_type *task;
-    ods_status status;
     if (n != 5 || strncmp(cmd, "start", n) != 0) return 0;
     ods_log_debug("[%s] start command", module_str);
     (void)snprintf(buf, ODS_SE_MAXLINE, "Scheduling autostart tasks.\n");
@@ -427,7 +422,7 @@
         handled_help_cmd,
         handled_unknown_cmd /* unknown command allways matches, so last entry */
     };
-    int cmdidx;
+    unsigned int cmdidx;
 
     ods_log_verbose("received command %s[%i]", cmd, n);
     
@@ -764,7 +759,6 @@
 const char *
 cmdhandler_command_peek_front(cmdhandler_type *cmdhandler)
 {
-    int i;
     const char *cmd;
     if (!cmdhandler)
         return NULL;

Modified: branches/OpenDNSSEC-enforcer-ng/enforcer-ng/src/daemon/engine.c
===================================================================
--- branches/OpenDNSSEC-enforcer-ng/enforcer-ng/src/daemon/engine.c	2011-08-19 12:51:10 UTC (rev 5429)
+++ branches/OpenDNSSEC-enforcer-ng/enforcer-ng/src/daemon/engine.c	2011-08-22 08:59:02 UTC (rev 5430)
@@ -262,7 +262,9 @@
 static void
 engine_create_drudgers(engine_type* engine)
 {
+#if HAVE_DRUDGERS
     size_t i = 0;
+#endif
     ods_log_assert(engine);
     ods_log_assert(engine->config);
     ods_log_assert(engine->allocator);
@@ -303,7 +305,9 @@
 static void
 engine_start_drudgers(engine_type* engine)
 {
+#if HAVE_DRUDGERS
     size_t i = 0;
+#endif
 
     ods_log_assert(engine);
     ods_log_assert(engine->config);
@@ -342,7 +346,9 @@
 static void
 engine_stop_drudgers(engine_type* engine)
 {
+#if HAVE_DRUDGERS
     size_t i = 0;
+#endif
 
     ods_log_assert(engine);
     ods_log_assert(engine->config);
@@ -498,9 +504,11 @@
 engine_setup(engine_type* engine, handled_xxxx_cmd_type *commands, 
              help_xxxx_cmd_type *help)
 {
+    ods_status status;
+
     engine->commands = commands;
     engine->help = help;
-    ods_status status = engine_setup_and_return_status(engine);
+    status = engine_setup_and_return_status(engine);
     if (status != ODS_STATUS_OK) {
         ods_log_error("[%s] setup failed: %s", engine_str,
                       ods_status2str(status));
@@ -585,7 +593,6 @@
 void 
 engine_runloop(engine_type* engine, int single_run)
 {
-    ods_status zl_changed = ODS_STATUS_UNCHANGED;
     /* run */
     while (engine->need_to_exit == 0) {
         
@@ -622,7 +629,6 @@
 {
     engine_type* engine = NULL;
     int use_syslog = 0;
-    task_type* task = NULL;
     ods_status status = ODS_STATUS_OK;
 
     ods_log_assert(cfgfile);

Modified: branches/OpenDNSSEC-enforcer-ng/enforcer-ng/src/daemon/worker.c
===================================================================
--- branches/OpenDNSSEC-enforcer-ng/enforcer-ng/src/daemon/worker.c	2011-08-19 12:51:10 UTC (rev 5429)
+++ branches/OpenDNSSEC-enforcer-ng/enforcer-ng/src/daemon/worker.c	2011-08-22 08:59:02 UTC (rev 5430)
@@ -150,8 +150,6 @@
 worker_work(worker_type* worker)
 {
     time_t now, timeout = 1;
-    void* context = NULL;
-    ods_status status = ODS_STATUS_OK;
     task_type *task_that_was_worked_on;
 
     ods_log_assert(worker);
@@ -231,7 +229,7 @@
 
     while (worker->need_to_exit == 0) {
         
-        // FIXME: Figure out whether we want to do something like e.g. generate keys..
+        /* FIXME: Figure out whether we want to do something like e.g. generate keys.. */
         int NOTHING_TO_DO = 1;
         
         ods_log_debug("[%s[%i]] report for duty", worker2str(worker->type),
@@ -280,10 +278,10 @@
 
             worker->clock_in = time(NULL);
             
-            // FIXME: perform some hsm related work, like key generation.
-            // We need to hookup a task here
+            /* FIXME: perform some hsm related work, like key generation. */
+            /* We need to hookup a task here */
             
-            status = ODS_STATUS_OK; // rrset_sign(ctx, rrset, context->dname, context->signconf, chief->clock_in, context->stats);
+            status = ODS_STATUS_OK; /* rrset_sign(ctx, rrset, context->dname, context->signconf, chief->clock_in, context->stats); */
         } else {
             status = ODS_STATUS_ASSERT_ERR;
         }

Modified: branches/OpenDNSSEC-enforcer-ng/enforcer-ng/src/ods-enforcer.c
===================================================================
--- branches/OpenDNSSEC-enforcer-ng/enforcer-ng/src/ods-enforcer.c	2011-08-19 12:51:10 UTC (rev 5429)
+++ branches/OpenDNSSEC-enforcer-ng/enforcer-ng/src/ods-enforcer.c	2011-08-22 08:59:02 UTC (rev 5430)
@@ -100,6 +100,7 @@
     int cmd_response = 0;
     fd_set rset;
     char buf[ODS_SE_MAXLINE];
+    int written;
 
     stdineof = 0;
     FD_ZERO(&rset);
@@ -181,7 +182,6 @@
             }
 
             /* n > 0 : when we get to this line... */
-            int written;
             for (written=0; written < n; written += ret) {
                 /* write what we got to stdout */
                 ret = (int) write(fileno(stdout), &buf[written], n-written);
@@ -193,7 +193,7 @@
                 if (ret < 0) {
                     if (errno == EINTR || errno == EWOULDBLOCK) {
                         ret = 0;
-                        continue; // try again...
+                        continue; /* try again... */
                     }
                     fprintf(stderr, "\n\nwrite error: %s\n", strerror(errno));
                     break;
@@ -353,8 +353,6 @@
 int
 main(int argc, char* argv[])
 {
-    int c;
-    int options_size = 0;
     char* cmd = NULL;
     allocator_type* clialloc = allocator_create(malloc, free);
     if (!clialloc) {

Modified: branches/OpenDNSSEC-enforcer-ng/enforcer-ng/src/parser/confparser.c
===================================================================
--- branches/OpenDNSSEC-enforcer-ng/enforcer-ng/src/parser/confparser.c	2011-08-19 12:51:10 UTC (rev 5429)
+++ branches/OpenDNSSEC-enforcer-ng/enforcer-ng/src/parser/confparser.c	2011-08-22 08:59:02 UTC (rev 5430)
@@ -57,7 +57,6 @@
     xmlRelaxNGParserCtxtPtr rngpctx = NULL;
     xmlRelaxNGValidCtxtPtr rngctx = NULL;
     xmlRelaxNGPtr schema = NULL;
-    int status = 0;
 
     if (!cfgfile || !rngfile) {
         ods_log_error("[%s] no cfgfile or rngfile", parser_str);

Modified: branches/OpenDNSSEC-enforcer-ng/enforcer-ng/src/scheduler/task.c
===================================================================
--- branches/OpenDNSSEC-enforcer-ng/enforcer-ng/src/scheduler/task.c	2011-08-19 12:51:10 UTC (rev 5429)
+++ branches/OpenDNSSEC-enforcer-ng/enforcer-ng/src/scheduler/task.c	2011-08-22 08:59:02 UTC (rev 5430)
@@ -86,7 +86,7 @@
 {
     int i;
     
-    // update existing registration
+    /* update existing registration */
     for (i=0; i<ntaskreg; ++i) {
         if (strcmp(long_name, taskreg[i].long_name)==0) {
             taskreg[i].how = how;
@@ -96,7 +96,7 @@
     
 	if (ntaskreg >= NUM_HOW_REG) {
 		ods_log_error("Unable to register additional name,how pairs for tasks.");
-		return;
+		return TASK_NONE;
 	}
     taskreg[ntaskreg].short_name = short_name;
 	taskreg[ntaskreg].long_name = long_name;
@@ -113,7 +113,6 @@
 {
     allocator_type* allocator = NULL;
     task_type* task = NULL;
-    int task_how_index;
 
     if (!who || !context) {
         ods_log_error("[%s] cannot create: missing context info", task_str);
@@ -165,8 +164,7 @@
     time_t when = 0;
     int flush = 0;
     time_t backoff = 0;
-	const char *long_name = NULL;
-	how_type how = NULL;
+    const char *long_name = NULL;
 
     ods_log_assert(context);
     fd = ods_fopen(filename, NULL, "r");
@@ -362,7 +360,7 @@
 char*
 task2str(task_type* task, char* buftask)
 {
-    char ctimebuf[32]; // at least 26 according to docs
+    char ctimebuf[32]; /* at least 26 according to docs */
     time_t now = time_now();
     char* strtime = NULL;
     char* strtask = NULL;
@@ -400,7 +398,7 @@
 void
 task_print(FILE* out, task_type* task)
 {
-    char ctimebuf[32]; // at least 26 according to docs
+    char ctimebuf[32]; /* at least 26 according to docs */
     time_t now = time_now();
     char* strtime = NULL;
 
@@ -427,7 +425,7 @@
 void
 task_log(task_type* task)
 {
-    char ctimebuf[32]; // at least 26 according to docs
+    char ctimebuf[32]; /* at least 26 according to docs */
     time_t now = time_now();
     char* strtime = NULL;
 

Modified: branches/OpenDNSSEC-enforcer-ng/enforcer-ng/src/shared/allocator.c
===================================================================
--- branches/OpenDNSSEC-enforcer-ng/enforcer-ng/src/shared/allocator.c	2011-08-19 12:51:10 UTC (rev 5429)
+++ branches/OpenDNSSEC-enforcer-ng/enforcer-ng/src/shared/allocator.c	2011-08-22 08:59:02 UTC (rev 5430)
@@ -66,7 +66,6 @@
 void*
 allocator_alloc(allocator_type* allocator, size_t size)
 {
-    size_t aligned_size;
     void* result;
 
     ods_log_assert(allocator);

Modified: branches/OpenDNSSEC-enforcer-ng/enforcer-ng/src/shared/str.c
===================================================================
--- branches/OpenDNSSEC-enforcer-ng/enforcer-ng/src/shared/str.c	2011-08-19 12:51:10 UTC (rev 5429)
+++ branches/OpenDNSSEC-enforcer-ng/enforcer-ng/src/shared/str.c	2011-08-22 08:59:02 UTC (rev 5430)
@@ -50,7 +50,7 @@
         char *pend = p+strlen(p);
         do {
             for (; p<pend && isspace(*p); ++p) {
-                *p = '\0'; // zero-out space characters
+                *p = '\0'; /* zero-out space characters */
             }
             if (p < pend) {
                 if (narg < argc) {
@@ -59,7 +59,7 @@
                     ++narg;
                 }
                 for (; p<pend && !isspace(*p); ++p) {
-                    // skip argv value itself
+                    /* skip argv value itself */
                 }
             }
         } while (p<pend);
@@ -125,7 +125,7 @@
                           module_str);
             return NULL;
         }
-        // strip trailing space characters including '\n' from time string
+        /* strip trailing space characters including '\n' from time string */
         for (p=pend-1; p>=pbeg && isspace(*p); --p) {
             *p = '\0';
         }
@@ -155,15 +155,15 @@
     for (i=0; i<*pargc; ++i) {
         const char *a = argv[i];
         if (a[0] == '-') {
-            // we found an option, now try to match it 
+            /* we found an option, now try to match it */
             int bmatch = 0;
             if (a[1] == '-')
-                bmatch = strcmp(&a[2],longname)==0; // longopt
+                bmatch = strcmp(&a[2],longname)==0; /* longopt */
             else
-                bmatch = strcmp(&a[1],shortname)==0; // shortopt
+                bmatch = strcmp(&a[1],shortname)==0; /* shortopt */
             if (bmatch) {
                 int j;
-                // remove matching option from argv
+                /* remove matching option from argv */
                 --(*pargc);
                 for (j=i; j<*pargc; ++j)
                     argv[j] = argv[j+1];
@@ -179,18 +179,19 @@
                            const char **pvalue)
 {
     int j;
+    const char *a;
     int i = ods_find_arg(pargc,argv,longname,shortname);
     if (i<0)
         return i;
-    const char *a = argv[i];
-    // check that the argv entry is not an option itself.
+    a = argv[i];
+    /* check that the argv entry is not an option itself. */
     if (a[0] == '-') {
         *pvalue = NULL;
         return i;
     }
-    // set the value to the argv 
+    /* set the value to the argv */
     *pvalue = a;
-    // remove parameter from argv
+    /* remove parameter from argv */
     --(*pargc);
     for (j=i; j<*pargc; ++j)
         argv[j] = argv[j+1];




More information about the Opendnssec-commits mailing list