diff options
author | Jens Arnold <amiconn@rockbox.org> | 2004-08-18 01:09:31 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2004-08-18 01:09:31 +0000 |
commit | 8fb336148fb34474c67fbc6e0354daa4512a22fb (patch) | |
tree | 5910d0a54bf8424b424939a263abef0f570591f7 /apps/settings.c | |
parent | 6d0da414bfea35b4370ad820d28d4565521d7b12 (diff) | |
download | rockbox-8fb336148fb34474c67fbc6e0354daa4512a22fb.tar.gz rockbox-8fb336148fb34474c67fbc6e0354daa4512a22fb.zip |
Const policed pointer arguments to functions, part 3
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4999 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/settings.c')
-rw-r--r-- | apps/settings.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/apps/settings.c b/apps/settings.c index 47969d1abe..b469ce6d54 100644 --- a/apps/settings.c +++ b/apps/settings.c | |||
@@ -339,7 +339,7 @@ static const struct bit_entry hd_bits[] = | |||
339 | 339 | ||
340 | /* helper function to extract n (<=32) bits from an arbitrary position */ | 340 | /* helper function to extract n (<=32) bits from an arbitrary position */ |
341 | static unsigned long get_bits( | 341 | static unsigned long get_bits( |
342 | unsigned long* p, /* the start of the bitfield array */ | 342 | const unsigned long* p, /* the start of the bitfield array */ |
343 | unsigned int from, /* bit no. to start reading from */ | 343 | unsigned int from, /* bit no. to start reading from */ |
344 | unsigned int size) /* how many bits to read */ | 344 | unsigned int size) /* how many bits to read */ |
345 | { | 345 | { |
@@ -418,7 +418,7 @@ static void set_bits( | |||
418 | * Calculates the checksum for the config block and returns it | 418 | * Calculates the checksum for the config block and returns it |
419 | */ | 419 | */ |
420 | 420 | ||
421 | static unsigned short calculate_config_checksum(unsigned char* buf) | 421 | static unsigned short calculate_config_checksum(const unsigned char* buf) |
422 | { | 422 | { |
423 | unsigned int i; | 423 | unsigned int i; |
424 | unsigned char cksum[2]; | 424 | unsigned char cksum[2]; |
@@ -890,8 +890,8 @@ void set_file(char* filename, char* setting, int maxlen) | |||
890 | static int load_cfg_table( | 890 | static int load_cfg_table( |
891 | const struct bit_entry* p_table, /* the table which describes the entries */ | 891 | const struct bit_entry* p_table, /* the table which describes the entries */ |
892 | int count, /* number of entries in the table, including the first */ | 892 | int count, /* number of entries in the table, including the first */ |
893 | char* name, /* the item to be searched */ | 893 | const char* name, /* the item to be searched */ |
894 | char* value, /* the value which got loaded for that item */ | 894 | const char* value, /* the value which got loaded for that item */ |
895 | int hint) /* position to start looking */ | 895 | int hint) /* position to start looking */ |
896 | { | 896 | { |
897 | int i = hint; | 897 | int i = hint; |
@@ -963,7 +963,7 @@ static int load_cfg_table( | |||
963 | } | 963 | } |
964 | 964 | ||
965 | 965 | ||
966 | bool settings_load_config(char* file) | 966 | bool settings_load_config(const char* file) |
967 | { | 967 | { |
968 | int fd; | 968 | int fd; |
969 | char line[128]; | 969 | char line[128]; |
@@ -1238,7 +1238,7 @@ void settings_reset(void) { | |||
1238 | 1238 | ||
1239 | } | 1239 | } |
1240 | 1240 | ||
1241 | bool set_bool(char* string, bool* variable ) | 1241 | bool set_bool(const char* string, bool* variable ) |
1242 | { | 1242 | { |
1243 | return set_bool_options(string, variable, | 1243 | return set_bool_options(string, variable, |
1244 | STR(LANG_SET_BOOL_YES), | 1244 | STR(LANG_SET_BOOL_YES), |
@@ -1256,9 +1256,9 @@ void bool_funcwrapper(int value) | |||
1256 | boolfunction(false); | 1256 | boolfunction(false); |
1257 | } | 1257 | } |
1258 | 1258 | ||
1259 | bool set_bool_options(char* string, bool* variable, | 1259 | bool set_bool_options(const char* string, bool* variable, |
1260 | char* yes_str, int yes_voice, | 1260 | const char* yes_str, int yes_voice, |
1261 | char* no_str, int no_voice, | 1261 | const char* no_str, int no_voice, |
1262 | void (*function)(bool)) | 1262 | void (*function)(bool)) |
1263 | { | 1263 | { |
1264 | struct opt_items names[] = { {no_str, no_voice}, {yes_str, yes_voice} }; | 1264 | struct opt_items names[] = { {no_str, no_voice}, {yes_str, yes_voice} }; |
@@ -1270,8 +1270,8 @@ bool set_bool_options(char* string, bool* variable, | |||
1270 | return result; | 1270 | return result; |
1271 | } | 1271 | } |
1272 | 1272 | ||
1273 | bool set_int(char* string, | 1273 | bool set_int(const char* string, |
1274 | char* unit, | 1274 | const char* unit, |
1275 | int voice_unit, | 1275 | int voice_unit, |
1276 | int* variable, | 1276 | int* variable, |
1277 | void (*function)(int), | 1277 | void (*function)(int), |
@@ -1391,7 +1391,7 @@ bool set_int(char* string, | |||
1391 | different and bit-incompatible types and can not share the same access | 1391 | different and bit-incompatible types and can not share the same access |
1392 | code. */ | 1392 | code. */ |
1393 | 1393 | ||
1394 | bool set_option(char* string, void* variable, enum optiontype type, | 1394 | bool set_option(const char* string, void* variable, enum optiontype type, |
1395 | const struct opt_items* options, int numoptions, void (*function)(int)) | 1395 | const struct opt_items* options, int numoptions, void (*function)(int)) |
1396 | { | 1396 | { |
1397 | bool done = false; | 1397 | bool done = false; |