]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
profiling: fix const compiler warnings
authorJason Ish <ish@unx.ca>
Wed, 31 May 2017 12:04:07 +0000 (06:04 -0600)
committerVictor Julien <victor@inliniac.net>
Thu, 1 Jun 2017 05:32:28 +0000 (07:32 +0200)
src/util-profiling-locks.c
src/util-profiling.c

index 7719e6d5b7323893d0098beecfd0444f9b4331d3..efbe9720fb266b0eafc36b67895d56c91c98a602 100644 (file)
@@ -38,7 +38,7 @@ __thread int record_locks = 0;
 int profiling_locks_enabled = 0;
 int profiling_locks_output_to_file = 0;
 char *profiling_locks_file_name = NULL;
-char *profiling_locks_file_mode = "a";
+const char *profiling_locks_file_mode = "a";
 
 typedef struct LockRecord_ {
     char *file; // hash
@@ -106,7 +106,7 @@ int LockRecordInitHash()
     return 0;
 }
 
-void LockRecordAdd(ProfilingLock *l)
+static void LockRecordAdd(ProfilingLock *l)
 {
     LockRecord fn = { NULL, NULL, 0,0,0,0,0,0}, *ptr = &fn;
     fn.file = l->file;
@@ -153,7 +153,7 @@ void SCProfilingAddPacketLocks(void *p)
     }
 }
 
-void SCProfilingListLocks(void)
+static void SCProfilingListLocks(void)
 {
     FILE *fp = NULL;
 
@@ -180,7 +180,7 @@ void SCProfilingListLocks(void)
     while (b) {
         LockRecord *r = HashListTableGetListData(b);
 
-        char *lock;
+        const char *lock;
         switch (r->type) {
             case LOCK_MUTEX:
                 lock = "mtx";
index d7ed401beac70eab89956b765a1cb8f9feedb065..871ab7a4cea0d5e97dfecdd6910b5f08f0a18189 100644 (file)
@@ -55,7 +55,7 @@ static FILE *packet_profile_csv_fp = NULL;
 extern int profiling_locks_enabled;
 extern int profiling_locks_output_to_file;
 extern char *profiling_locks_file_name;
-extern char *profiling_locks_file_mode;
+extern const char *profiling_locks_file_mode;
 
 typedef struct SCProfilePacketData_ {
     uint64_t min;
@@ -255,8 +255,7 @@ SCProfilingInit(void)
 
             const char *filename = ConfNodeLookupChildValue(conf, "filename");
             if (filename != NULL) {
-                char *log_dir;
-                log_dir = ConfigGetLogDirectory();
+                const char *log_dir = ConfigGetLogDirectory();
 
                 profiling_locks_file_name = SCMalloc(PATH_MAX);
                 if (unlikely(profiling_locks_file_name == NULL)) {