summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2013-05-22 08:08:24 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2013-05-22 08:08:24 +0200
commit32962a658cbb35c6333e7b63582f3a09dbf911e2 (patch)
tree165a336c20023dfe3be0068a3c6894aa20e5b217 /src
parent98d6fb5d1f1cd092c8c083f62b3bac59fd86d39b (diff)
Declare as const some static variables
Diffstat (limited to 'src')
-rw-r--r--src/common.c2
-rw-r--r--src/fat_adv.c4
-rw-r--r--src/geometryn.c2
-rw-r--r--src/intrfn.c8
-rw-r--r--src/ntfs_fix.c2
-rw-r--r--src/partgptn.c2
-rw-r--r--src/parti386n.c2
-rw-r--r--src/partmacn.c2
-rw-r--r--src/partsunn.c2
-rw-r--r--src/partxboxn.c2
-rw-r--r--src/tdisksel.c2
-rw-r--r--src/tlog.c2
12 files changed, 16 insertions, 16 deletions
diff --git a/src/common.c b/src/common.c
index 714a577..3e008f1 100644
--- a/src/common.c
+++ b/src/common.c
@@ -223,7 +223,7 @@ char* strip_dup(char* str)
int date_dos2unix(const unsigned short f_time, const unsigned short f_date)
{
- static int day_n[] = { 0,31,59,90,120,151,181,212,243,273,304,334,0,0,0,0 };
+ static const int day_n[] = { 0,31,59,90,120,151,181,212,243,273,304,334,0,0,0,0 };
/* JanFebMarApr May Jun Jul Aug Sep Oct Nov Dec */
int month,year,secs;
diff --git a/src/fat_adv.c b/src/fat_adv.c
index c427886..74f3f2c 100644
--- a/src/fat_adv.c
+++ b/src/fat_adv.c
@@ -578,11 +578,11 @@ static unsigned int fat32_find_root_cluster(disk_t *disk_car,const partition_t *
}
#ifdef HAVE_NCURSES
-static int day_n[] = { 0,31,59,90,120,151,181,212,243,273,304,334,0,0,0,0 };
- /* JanFebMarApr May Jun Jul Aug Sep Oct Nov Dec */
static void fat_date_unix2dos(int unix_date,unsigned short *mstime, unsigned short *msdate)
{
+ static const int day_n[] = { 0,31,59,90,120,151,181,212,243,273,304,334,0,0,0,0 };
+ /* JanFebMarApr May Jun Jul Aug Sep Oct Nov Dec */
int day,year,nl_day,month;
/* unix_date -= sys_tz.tz_minuteswest*60; */
diff --git a/src/geometryn.c b/src/geometryn.c
index 80b1990..44dc3aa 100644
--- a/src/geometryn.c
+++ b/src/geometryn.c
@@ -55,7 +55,7 @@ int change_geometry_ncurses(disk_t *disk_car)
char response[128];
long int tmp_val=0;
int command;
- static struct MenuItem menuGeometry[]=
+ static const struct MenuItem menuGeometry[]=
{
{ 'c', "Cylinders", "Change cylinder geometry" },
{ 'h', "Heads", "Change head geometry" },
diff --git a/src/intrfn.c b/src/intrfn.c
index 33a2600..1413fe6 100644
--- a/src/intrfn.c
+++ b/src/intrfn.c
@@ -591,7 +591,7 @@ void dump(WINDOW *window, const void *nom_dump,unsigned int lng)
int done=0;
unsigned int menu=2; /* default : quit */
const char *options="PNQ";
- struct MenuItem menuDump[]=
+ const struct MenuItem menuDump[]=
{
{ 'P', "Previous",""},
{ 'N', "Next","" },
@@ -700,7 +700,7 @@ void dump2(WINDOW *window, const void *dump_1, const void *dump_2, const unsigne
int done=0;
unsigned int menu=2; /* default : quit */
const char *options="PNQ";
- struct MenuItem menuDump[]=
+ const struct MenuItem menuDump[]=
{
{ 'P', "Previous",""},
{ 'N', "Next","" },
@@ -863,7 +863,7 @@ int screen_buffer_display_ext(WINDOW *window, const char *options_org, const str
int current_line=0;
int done=0;
char options[20];
- struct MenuItem menuDefault[]=
+ const struct MenuItem menuDefault[]=
{
{ 'P', "Previous",""},
{ 'N', "Next","" },
@@ -1317,7 +1317,7 @@ int vaff_txt(int line, WINDOW *window, const char *_format, va_list ap)
void display_message(const char*msg)
{
int pipo=0;
- static struct MenuItem menuGeometry[]=
+ static const struct MenuItem menuGeometry[]=
{
{ 'Q', "Ok", "" },
{ 0, NULL, NULL }
diff --git a/src/ntfs_fix.c b/src/ntfs_fix.c
index 48402ed..852f476 100644
--- a/src/ntfs_fix.c
+++ b/src/ntfs_fix.c
@@ -246,7 +246,7 @@ int repair_MFT(disk_t *disk_car, partition_t *partition, const int verbose, cons
unsigned int menu=2;
int real_key;
int command;
- static struct MenuItem menuMFT[]=
+ static const struct MenuItem menuMFT[]=
{
{'B',"MFT", "Fix MFT using MFT mirror"},
{'M',"MFT Mirror", "Fix MFT mirror using MFT"},
diff --git a/src/partgptn.c b/src/partgptn.c
index c0faf3a..dbe320a 100644
--- a/src/partgptn.c
+++ b/src/partgptn.c
@@ -62,7 +62,7 @@ list_part_t *add_partition_gpt_ncurses(disk_t *disk_car, list_part_t *list_part)
while (done==FALSE)
{
int command;
- static struct MenuItem menuGeometry[]=
+ static const struct MenuItem menuGeometry[]=
{
{ 's', "Sector", "Change starting sector" },
{ 'S', "Sector", "Change ending sector" },
diff --git a/src/parti386n.c b/src/parti386n.c
index 342b473..2513bd1 100644
--- a/src/parti386n.c
+++ b/src/parti386n.c
@@ -125,7 +125,7 @@ list_part_t *add_partition_i386_ncurses(disk_t *disk_car, list_part_t *list_part
while (done==0)
{
int command;
- static struct MenuItem menuGeometry[]=
+ static const struct MenuItem menuGeometry[]=
{
{ 'c', "Cylinder", "Change starting cylinder" },
{ 'h', "Head", "Change starting head" },
diff --git a/src/partmacn.c b/src/partmacn.c
index 8a7fa56..31e7fad 100644
--- a/src/partmacn.c
+++ b/src/partmacn.c
@@ -75,7 +75,7 @@ list_part_t *add_partition_mac_ncurses(disk_t *disk_car, list_part_t *list_part)
while (done==FALSE)
{
int command;
- static struct MenuItem menuGeometry[]=
+ static const struct MenuItem menuGeometry[]=
{
{ 's', "Sector", "Change starting sector" },
{ 'S', "Sector", "Change ending sector" },
diff --git a/src/partsunn.c b/src/partsunn.c
index e9db981..beafea7 100644
--- a/src/partsunn.c
+++ b/src/partsunn.c
@@ -55,7 +55,7 @@ list_part_t *add_partition_sun_ncurses(disk_t *disk_car, list_part_t *list_part)
int done = FALSE;
while (done==FALSE) {
int command;
- static struct MenuItem menuGeometry[]=
+ static const struct MenuItem menuGeometry[]=
{
{ 'c', "Cylinders", "Change starting cylinder" },
{ 'C', "Cylinders", "Change ending cylinder" },
diff --git a/src/partxboxn.c b/src/partxboxn.c
index 5914391..a504bd1 100644
--- a/src/partxboxn.c
+++ b/src/partxboxn.c
@@ -50,7 +50,7 @@ list_part_t *add_partition_xbox_ncurses(disk_t *disk_car, list_part_t *list_part
while (done==FALSE)
{
int command;
- static struct MenuItem menuGeometry[]=
+ static const struct MenuItem menuGeometry[]=
{
{ 's', "Sector", "Change starting sector" },
{ 'S', "Sector", "Change ending sector" },
diff --git a/src/tdisksel.c b/src/tdisksel.c
index f2c11dd..55f7f1f 100644
--- a/src/tdisksel.c
+++ b/src/tdisksel.c
@@ -65,7 +65,7 @@ static int testdisk_disk_selection_ncurses(int verbose,int dump_ind, const list_
int use_sudo=0;
const list_disk_t *element_disk;
const list_disk_t *current_disk;
- static struct MenuItem menuMain[]=
+ static const struct MenuItem menuMain[]=
{
{ 'P', "Previous", ""},
{ 'N', "Next", "" },
diff --git a/src/tlog.c b/src/tlog.c
index 2130f98..0164890 100644
--- a/src/tlog.c
+++ b/src/tlog.c
@@ -37,7 +37,7 @@
int ask_testdisk_log_creation(void)
{
unsigned int menu=0;
- static struct MenuItem menuLogCreation[]=
+ static const struct MenuItem menuLogCreation[]=
{
{'C',"Create","Create a new log file"},
{'A',"Append","Append information to log file"},