summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarin Ramesa <mpr@hi.t-com.hr>2013-12-20 13:29:00 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2013-12-20 23:51:47 +0100
commitbe1ce42e936c96776b661ba5a93b0c9d0d76bb31 (patch)
treeacbb27da29a312d03fbed7cce1f2069c44cfcfd9
parent2b33e316ac0d14b564ade0dd6fc3be136e945926 (diff)
Mark pure functions with attribute pure
-rw-r--r--ddb/db_aout.c4
-rw-r--r--ddb/db_break.c4
-rw-r--r--ddb/db_break.h2
-rw-r--r--ddb/db_command.c2
-rw-r--r--ddb/db_command.h2
-rw-r--r--ddb/db_output.c2
-rw-r--r--ddb/db_output.h2
-rw-r--r--ddb/db_run.c2
-rw-r--r--ddb/db_sym.c2
-rw-r--r--device/dev_name.c2
-rw-r--r--include/string.h8
-rw-r--r--kern/strings.c4
12 files changed, 18 insertions, 18 deletions
diff --git a/ddb/db_aout.c b/ddb/db_aout.c
index 57c680a..87ba975 100644
--- a/ddb/db_aout.c
+++ b/ddb/db_aout.c
@@ -132,7 +132,7 @@ aout_db_sym_init(symtab, esymtab, name, task_addr)
/*
* check file name or not (check xxxx.x pattern)
*/
-private boolean_t
+private boolean_t __attribute__ ((pure))
aout_db_is_filename(name)
const char *name;
{
@@ -149,7 +149,7 @@ aout_db_is_filename(name)
/*
* special name comparison routine with a name in the symbol table entry
*/
-private boolean_t
+private boolean_t __attribute__ ((pure))
aout_db_eq_name(sp, name)
const struct nlist *sp;
const char *name;
diff --git a/ddb/db_break.c b/ddb/db_break.c
index e41834d..0534f68 100644
--- a/ddb/db_break.c
+++ b/ddb/db_break.c
@@ -154,7 +154,7 @@ db_delete_thread_breakpoint(bkpt, task_thd)
}
}
-static db_thread_breakpoint_t
+static db_thread_breakpoint_t __attribute__ ((pure))
db_find_thread_breakpoint(bkpt, thread)
const db_breakpoint_t bkpt;
const thread_t thread;
@@ -350,7 +350,7 @@ db_delete_breakpoint(task, addr, task_thd)
}
}
-db_breakpoint_t
+db_breakpoint_t __attribute__ ((pure))
db_find_breakpoint(task, addr)
const task_t task;
db_addr_t addr;
diff --git a/ddb/db_break.h b/ddb/db_break.h
index 2dfa804..610af2f 100644
--- a/ddb/db_break.h
+++ b/ddb/db_break.h
@@ -71,7 +71,7 @@ struct db_breakpoint {
typedef struct db_breakpoint *db_breakpoint_t;
-extern db_breakpoint_t db_find_breakpoint( const task_t task, db_addr_t addr);
+extern db_breakpoint_t db_find_breakpoint( const task_t task, db_addr_t addr) __attribute__ ((pure));
extern boolean_t db_find_breakpoint_here( const task_t task, db_addr_t addr);
extern void db_set_breakpoints(void);
extern void db_clear_breakpoints(void);
diff --git a/ddb/db_command.c b/ddb/db_command.c
index 3257e07..3879ec5 100644
--- a/ddb/db_command.c
+++ b/ddb/db_command.c
@@ -522,7 +522,7 @@ db_fncall(void)
db_printf(" %#N\n", retval);
}
-boolean_t
+boolean_t __attribute__ ((pure))
db_option(modif, option)
const char *modif;
int option;
diff --git a/ddb/db_command.h b/ddb/db_command.h
index 634dd9d..4208bda 100644
--- a/ddb/db_command.h
+++ b/ddb/db_command.h
@@ -41,7 +41,7 @@
#include <machine/setjmp.h>
extern void db_command_loop(void);
-extern boolean_t db_option(const char *, int);
+extern boolean_t db_option(const char *, int) __attribute__ ((pure));
extern void db_error(const char *) __attribute__ ((noreturn)); /* report error */
diff --git a/ddb/db_output.c b/ddb/db_output.c
index f7561d2..f2829cc 100644
--- a/ddb/db_output.c
+++ b/ddb/db_output.c
@@ -188,7 +188,7 @@ db_id_putc(char c, vm_offset_t dummy)
/*
* Return output position
*/
-int
+int __attribute__ ((pure))
db_print_position(void)
{
return (db_output_position);
diff --git a/ddb/db_output.h b/ddb/db_output.h
index e886647..497ae43 100644
--- a/ddb/db_output.h
+++ b/ddb/db_output.h
@@ -36,7 +36,7 @@
#define _DDB_DB_OUTPUT_H_
extern void db_force_whitespace(void);
-extern int db_print_position(void);
+extern int db_print_position(void) __attribute__ ((pure));
extern void db_end_line(void);
extern void db_printf(const char *fmt, ...);
/* alternate name */
diff --git a/ddb/db_run.c b/ddb/db_run.c
index 945d097..6e409ff 100644
--- a/ddb/db_run.c
+++ b/ddb/db_run.c
@@ -249,7 +249,7 @@ db_single_step(regs, task)
db_breakpoint_t db_not_taken_bkpt = 0;
db_breakpoint_t db_taken_bkpt = 0;
-db_breakpoint_t
+db_breakpoint_t __attribute__ ((pure))
db_find_temp_breakpoint(task, addr)
const task_t task;
db_addr_t addr;
diff --git a/ddb/db_sym.c b/ddb/db_sym.c
index bbf14bd..beb4d18 100644
--- a/ddb/db_sym.c
+++ b/ddb/db_sym.c
@@ -88,7 +88,7 @@ db_add_symbol_table(type, start, end, name, ref, map_pointer)
* Note: return value points to static data whose content is
* overwritten by each call... but in practice this seems okay.
*/
-static char *
+static char * __attribute__ ((pure))
db_qualify(symname, symtabname)
const char *symname;
const char *symtabname;
diff --git a/device/dev_name.c b/device/dev_name.c
index 49d96aa..4cc046a 100644
--- a/device/dev_name.c
+++ b/device/dev_name.c
@@ -63,7 +63,7 @@ nomap(void)
* src and target are equal in first 'len' characters
* next character of target is 0 (end of string).
*/
-boolean_t
+boolean_t __attribute__ ((pure))
name_equal(src, len, target)
const char *src;
int len;
diff --git a/include/string.h b/include/string.h
index c77d387..c31b429 100644
--- a/include/string.h
+++ b/include/string.h
@@ -32,7 +32,7 @@ extern void *memcpy (void *dest, const void *src, size_t n);
extern void *memmove (void *dest, const void *src, size_t n);
-extern int memcmp (const void *s1, const void *s2, size_t n);
+extern int memcmp (const void *s1, const void *s2, size_t n) __attribute__ ((pure));
extern void *memset (void *s, int c, size_t n);
@@ -46,11 +46,11 @@ extern char *strrchr (const char *s, int c);
extern char *strsep (char **strp, const char *delim);
-extern int strcmp (const char *s1, const char *s2);
+extern int strcmp (const char *s1, const char *s2) __attribute__ ((pure));
-extern int strncmp (const char *s1, const char *s2, size_t n);
+extern int strncmp (const char *s1, const char *s2, size_t n) __attribute__ ((pure));
-extern size_t strlen (const char *s);
+extern size_t strlen (const char *s) __attribute__ ((pure));
extern char *strstr(const char *haystack, const char *needle);
diff --git a/kern/strings.c b/kern/strings.c
index 72eb4f3..c77ae4f 100644
--- a/kern/strings.c
+++ b/kern/strings.c
@@ -53,7 +53,7 @@
* contents are identical upto the length of s1.
*/
-int
+int __attribute__ ((pure))
strcmp(
const char *s1,
const char *s2)
@@ -80,7 +80,7 @@ strcmp(
* comparison runs for at most "n" characters.
*/
-int
+int __attribute__ ((pure))
strncmp(
const char *s1,
const char *s2,