libsemanage: fix gcc -Wwrite-strings warnings

Acked-by: Steve Lawrence <slawrence@tresys.com>
This commit is contained in:
Nicolas Iooss 2014-09-14 23:41:45 +02:00 committed by Steve Lawrence
parent 81f17737e7
commit b8b0d7fa8a
3 changed files with 8 additions and 8 deletions

View file

@ -32,7 +32,7 @@
#include <string.h> #include <string.h>
extern int semanage_lex(); /* defined in conf-scan.c */ extern int semanage_lex(); /* defined in conf-scan.c */
int semanage_error(char *msg); int semanage_error(const char *msg);
extern FILE *semanage_in; extern FILE *semanage_in;
extern char *semanage_text; extern char *semanage_text;
@ -442,7 +442,7 @@ void semanage_conf_destroy(semanage_conf_t * conf)
} }
} }
int semanage_error(char *msg) int semanage_error(const char *msg)
{ {
fprintf(stderr, "error parsing semanage configuration file: %s\n", msg); fprintf(stderr, "error parsing semanage configuration file: %s\n", msg);
parse_errors++; parse_errors++;

View file

@ -31,7 +31,7 @@
#define TRUE 1 #define TRUE 1
#define FALSE 0 #define FALSE 0
char *semanage_findval(char *file, char *var, char *delim) char *semanage_findval(const char *file, const char *var, const char *delim)
{ {
FILE *fd; FILE *fd;
char *buff = NULL; char *buff = NULL;
@ -134,7 +134,7 @@ char *semanage_split(const char *str, const char *delim)
return retval; return retval;
} }
int semanage_list_push(semanage_list_t ** list, char *data) int semanage_list_push(semanage_list_t ** list, const char *data)
{ {
semanage_list_t *temp = NULL; semanage_list_t *temp = NULL;
@ -185,7 +185,7 @@ void semanage_list_destroy(semanage_list_t ** list)
} }
} }
semanage_list_t *semanage_list_find(semanage_list_t * l, char *data) semanage_list_t *semanage_list_find(semanage_list_t * l, const char *data)
{ {
if (!data) if (!data)
return NULL; return NULL;

View file

@ -52,7 +52,7 @@ typedef struct list {
* *
* NULL for error (out of memory, etc) * NULL for error (out of memory, etc)
*/ */
char *semanage_findval(char *file, char *var, char *delim) WARN_UNUSED; char *semanage_findval(const char *file, const char *var, const char *delim) WARN_UNUSED;
/** /**
* @param str string to test * @param str string to test
@ -88,11 +88,11 @@ char *semanage_split(const char *str, const char *delim) WARN_UNUSED;
* Functions allocate memory. Must be free'd with * Functions allocate memory. Must be free'd with
* either semanage_list_pop until list == NULL or semanage_list_destroy() * either semanage_list_pop until list == NULL or semanage_list_destroy()
*/ */
int semanage_list_push(semanage_list_t ** list, char *data) WARN_UNUSED; int semanage_list_push(semanage_list_t ** list, const char *data) WARN_UNUSED;
char *semanage_list_pop(semanage_list_t ** list); char *semanage_list_pop(semanage_list_t ** list);
void semanage_list_destroy(semanage_list_t ** list); void semanage_list_destroy(semanage_list_t ** list);
semanage_list_t *semanage_list_find(semanage_list_t * l, semanage_list_t *semanage_list_find(semanage_list_t * l,
char *data) WARN_UNUSED; const char *data) WARN_UNUSED;
int semanage_list_sort(semanage_list_t ** l) WARN_UNUSED; int semanage_list_sort(semanage_list_t ** l) WARN_UNUSED;
/* function to compare 2 semanage_list_t nodes, /* function to compare 2 semanage_list_t nodes,
* returns strcmp(x->data, y->data) * returns strcmp(x->data, y->data)