summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrbuj <[email protected]>2019-09-05 12:02:59 +0200
committerlukefromdc <[email protected]>2019-09-08 19:35:20 +0000
commit4fb087c731af5282dc817bfc8350afe325eef532 (patch)
treeffc3f2b3660a8937085135062d7ff1b34846a73f /src
parenta837a98bf1d2b82b4ac7b773b892d9a411e19e77 (diff)
downloadengrampa-4fb087c731af5282dc817bfc8350afe325eef532.tar.bz2
engrampa-4fb087c731af5282dc817bfc8350afe325eef532.tar.xz
Initialization discards ‘const’ qualifier from pointer target type
Remove 317 warnings [-Wdiscarded-qualifiers].
Diffstat (limited to 'src')
-rw-r--r--src/actions.c4
-rw-r--r--src/dlg-new.c2
-rw-r--r--src/fr-command-ar.c8
-rw-r--r--src/fr-command-cpio.c6
-rw-r--r--src/fr-command-iso.c6
-rw-r--r--src/fr-command-lha.c8
-rw-r--r--src/fr-command-rpm.c6
-rw-r--r--src/fr-command-tar.c4
-rw-r--r--src/fr-command.c26
-rw-r--r--src/fr-stock.c4
-rw-r--r--src/fr-window.c2
-rw-r--r--src/typedefs.h6
12 files changed, 41 insertions, 41 deletions
diff --git a/src/actions.c b/src/actions.c
index bbb88f1..fee89d5 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -122,7 +122,7 @@ get_full_uri (DlgNewData *data)
idx = egg_file_format_chooser_get_format (EGG_FILE_FORMAT_CHOOSER (data->format_chooser), uri);
if (idx > 0) {
const char *uri_ext;
- char *default_ext;
+ const char *default_ext;
uri_ext = get_archive_filename_extension (uri);
default_ext = mime_type_desc[data->supported_types[idx-1]].default_ext;
@@ -209,7 +209,7 @@ get_archive_filename_from_selector (DlgNewData *data)
if (get_archive_filename_extension (uri) == NULL) {
int idx;
char *new_uri;
- char *ext = NULL;
+ const char *ext = NULL;
idx = egg_file_format_chooser_get_format (EGG_FILE_FORMAT_CHOOSER (data->format_chooser), uri);
if (idx > 0)
diff --git a/src/dlg-new.c b/src/dlg-new.c
index 57cd301..d7e6469 100644
--- a/src/dlg-new.c
+++ b/src/dlg-new.c
@@ -326,7 +326,7 @@ dlg_new_archive (FrWindow *window,
data->format_chooser = (EggFileFormatChooser *) egg_file_format_chooser_new ();
for (i = 0; data->supported_types[i] != -1; i++) {
int idx = data->supported_types[i];
- char *exts[4];
+ const char *exts[4];
int e;
int n_exts;
char *icon_name;
diff --git a/src/fr-command-ar.c b/src/fr-command-ar.c
index 2e2ae70..e1397be 100644
--- a/src/fr-command-ar.c
+++ b/src/fr-command-ar.c
@@ -48,10 +48,10 @@ mktime_from_string (char *time_s,
char *month_s,
char *year_s)
{
- static char *months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
- "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
- struct tm tm = {0, };
- char **fields;
+ static const char *months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
+ "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
+ struct tm tm = {0, };
+ char **fields;
tm.tm_isdst = -1;
diff --git a/src/fr-command-cpio.c b/src/fr-command-cpio.c
index 35a739d..19a3ed1 100644
--- a/src/fr-command-cpio.c
+++ b/src/fr-command-cpio.c
@@ -49,9 +49,9 @@ mktime_from_string (char *month,
char *mday,
char *year)
{
- static char *months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
- "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
- struct tm tm = {0, };
+ static const char *months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
+ "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
+ struct tm tm = {0, };
tm.tm_isdst = -1;
diff --git a/src/fr-command-iso.c b/src/fr-command-iso.c
index 9116b6e..3be83db 100644
--- a/src/fr-command-iso.c
+++ b/src/fr-command-iso.c
@@ -47,9 +47,9 @@ mktime_from_string (char *month,
char *mday,
char *year)
{
- static char *months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
- "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
- struct tm tm = {0, };
+ static const char *months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
+ "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
+ struct tm tm = {0, };
tm.tm_isdst = -1;
diff --git a/src/fr-command-lha.c b/src/fr-command-lha.c
index a3b7398..4d00af7 100644
--- a/src/fr-command-lha.c
+++ b/src/fr-command-lha.c
@@ -48,10 +48,10 @@ mktime_from_string (char *month,
char *mday,
char *time_or_year)
{
- static char *months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
- "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
- struct tm tm = {0, };
- char **fields;
+ static const char *months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
+ "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
+ struct tm tm = {0, };
+ char **fields;
tm.tm_isdst = -1;
diff --git a/src/fr-command-rpm.c b/src/fr-command-rpm.c
index bb14562..d4aff5e 100644
--- a/src/fr-command-rpm.c
+++ b/src/fr-command-rpm.c
@@ -49,9 +49,9 @@ mktime_from_string (char *month,
char *mday,
char *year)
{
- static char *months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
- "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
- struct tm tm = {0, };
+ static const char *months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
+ "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
+ struct tm tm = {0, };
tm.tm_isdst = -1;
diff --git a/src/fr-command-tar.c b/src/fr-command-tar.c
index 0c17433..62c77a9 100644
--- a/src/fr-command-tar.c
+++ b/src/fr-command-tar.c
@@ -1102,7 +1102,7 @@ fr_command_tar_get_capabilities (FrCommand *comm,
capabilities |= FR_COMMAND_CAN_READ_WRITE;
}
else if (is_mime_type (mime_type, "application/x-7z-compressed-tar")) {
- char *try_command[3] = { "7za", "7zr", "7z" };
+ const char *try_command[3] = { "7za", "7zr", "7z" };
size_t i;
for (i = 0; i < G_N_ELEMENTS (try_command); i++) {
@@ -1126,7 +1126,7 @@ fr_command_tar_set_mime_type (FrCommand *comm,
FR_COMMAND_CLASS (parent_class)->set_mime_type (comm, mime_type);
if (is_mime_type (mime_type, "application/x-7z-compressed-tar")) {
- char *try_command[3] = { "7za", "7zr", "7z" };
+ const char *try_command[3] = { "7za", "7zr", "7z" };
size_t i;
for (i = 0; i < G_N_ELEMENTS (try_command); i++) {
diff --git a/src/fr-command.c b/src/fr-command.c
index 5bc4cc8..9077d18 100644
--- a/src/fr-command.c
+++ b/src/fr-command.c
@@ -65,19 +65,19 @@ static void fr_command_class_init (FrCommandClass *class);
static void fr_command_init (FrCommand *afile);
static void fr_command_finalize (GObject *object);
-char *action_names[] = { "NONE",
- "CREATING_NEW_ARCHIVE",
- "LOADING_ARCHIVE",
- "LISTING_CONTENT",
- "DELETING_FILES",
- "TESTING_ARCHIVE",
- "GETTING_FILE_LIST",
- "COPYING_FILES_FROM_REMOTE",
- "ADDING_FILES",
- "EXTRACTING_FILES",
- "COPYING_FILES_TO_REMOTE",
- "CREATING_ARCHIVE",
- "SAVING_REMOTE_ARCHIVE" };
+const char *action_names[] = { "NONE",
+ "CREATING_NEW_ARCHIVE",
+ "LOADING_ARCHIVE",
+ "LISTING_CONTENT",
+ "DELETING_FILES",
+ "TESTING_ARCHIVE",
+ "GETTING_FILE_LIST",
+ "COPYING_FILES_FROM_REMOTE",
+ "ADDING_FILES",
+ "EXTRACTING_FILES",
+ "COPYING_FILES_TO_REMOTE",
+ "CREATING_ARCHIVE",
+ "SAVING_REMOTE_ARCHIVE" };
GType
fr_command_get_type ()
diff --git a/src/fr-stock.c b/src/fr-stock.c
index 27ba5cd..e292b04 100644
--- a/src/fr-stock.c
+++ b/src/fr-stock.c
@@ -29,8 +29,8 @@
static gboolean stock_initialized = FALSE;
static const struct {
- char *stock_id;
- char *icon;
+ const char *stock_id;
+ const char *icon;
} stock_icons [] = {
{ FR_STOCK_CREATE_ARCHIVE, "add-files-to-archive" },
{ FR_STOCK_ADD_FILES, "add-files-to-archive" },
diff --git a/src/fr-window.c b/src/fr-window.c
index db9d7af..9692aac 100644
--- a/src/fr-window.c
+++ b/src/fr-window.c
@@ -4869,7 +4869,7 @@ static void
add_file_list_columns (FrWindow *window,
GtkTreeView *treeview)
{
- static char *titles[] = {NC_("File", "Size"),
+ static const char *titles[] = {NC_("File", "Size"),
NC_("File", "Type"),
NC_("File", "Date Modified"),
NC_("File", "Location")};
diff --git a/src/typedefs.h b/src/typedefs.h
index 0206f51..82ce933 100644
--- a/src/typedefs.h
+++ b/src/typedefs.h
@@ -111,13 +111,13 @@ typedef struct {
typedef struct {
const char *mime_type;
- char *default_ext;
- char *name;
+ const char *default_ext;
+ const char *name;
FrCommandCaps capabilities;
} FrMimeTypeDescription;
typedef struct {
- char *ext;
+ const char *ext;
const char *mime_type;
} FrExtensionType;