From: Matthias Braun Date: Fri, 28 May 2010 10:46:29 +0000 (+0000) Subject: remove double const for idents X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=b2d1648a97fb43656495fd1cc25aa3f8e98ec769;p=libfirm remove double const for idents [r27596] --- diff --git a/include/libfirm/ident.h b/include/libfirm/ident.h index 0c6c0ed65..a1fbc1f48 100644 --- a/include/libfirm/ident.h +++ b/include/libfirm/ident.h @@ -67,7 +67,7 @@ FIRM_API ident *new_id_from_chars(const char *str, size_t len); * @return cp a string * @see new_id_from_str(), new_id_from_chars(), get_id_strlen() */ -FIRM_API const char *get_id_str(const ident *id); +FIRM_API const char *get_id_str(ident *id); /** * Returns the length of the string represented by an ident. @@ -76,7 +76,7 @@ FIRM_API const char *get_id_str(const ident *id); * @return len the length of the string * @see new_id_from_str(), new_id_from_chars(), get_id_str() */ -FIRM_API size_t get_id_strlen(const ident *id); +FIRM_API size_t get_id_strlen(ident *id); /** * Returns true if prefix is a prefix of an ident. @@ -85,7 +85,7 @@ FIRM_API size_t get_id_strlen(const ident *id); * @param id the ident * @see new_id_from_str(), new_id_from_chars(), get_id_str(), id_is_prefix() */ -FIRM_API int id_is_prefix(const ident *prefix, const ident *id); +FIRM_API int id_is_prefix(ident *prefix, ident *id); /** * Returns true if suffix is a suffix of an ident. @@ -94,7 +94,7 @@ FIRM_API int id_is_prefix(const ident *prefix, const ident *id); * @param id the ident * @see new_id_from_str(), new_id_from_chars(), get_id_str(), id_is_prefix() */ -FIRM_API int id_is_suffix(const ident *suffix, const ident *id); +FIRM_API int id_is_suffix(ident *suffix, ident *id); /** * Return true if an ident contains a given character. @@ -103,7 +103,7 @@ FIRM_API int id_is_suffix(const ident *suffix, const ident *id); * @param c the character * @see new_id_from_str(), new_id_from_chars(), get_id_str() */ -FIRM_API int id_contains_char(const ident *id, char c); +FIRM_API int id_contains_char(ident *id, char c); /** * helper function for creating unique idents. It contains an internal counter @@ -117,20 +117,20 @@ FIRM_API ident *id_unique(const char *tag); FIRM_API ident *id_mangle_entity(const ir_entity *ent); /** mangle underscore: Returns a new ident that represents first_scnd. */ -FIRM_API ident *id_mangle_u(const ident *first, const ident* scnd); +FIRM_API ident *id_mangle_u(ident *first, ident* scnd); /** mangle dot: Returns a new ident that represents first.scnd. */ -FIRM_API ident *id_mangle_dot(const ident *first, const ident* scnd); +FIRM_API ident *id_mangle_dot(ident *first, ident* scnd); /** mangle: Returns a new ident that represents firstscnd. */ -FIRM_API ident *id_mangle(const ident *first, const ident* scnd); +FIRM_API ident *id_mangle(ident *first, ident* scnd); /** Returns a new ident that represents 'prefixscndsuffix'. */ -FIRM_API ident *id_mangle3(const char *prefix, const ident *middle, +FIRM_API ident *id_mangle3(const char *prefix, ident *middle, const char *suffix); /** returns a mangled name for a Win32 function using its calling convention */ -FIRM_API ident *id_decorate_win32_c_fkt(const ir_entity *ent, const ident *id); +FIRM_API ident *id_decorate_win32_c_fkt(const ir_entity *ent, ident *id); #include "end.h" diff --git a/ir/ident/ident.c b/ir/ident/ident.c index 29ed01f2c..4633ebd6e 100644 --- a/ir/ident/ident.c +++ b/ir/ident/ident.c @@ -58,13 +58,13 @@ ident *new_id_from_str(const char *str) return new_id_from_chars(str, strlen(str)); } -const char *get_id_str(const ident *id) +const char *get_id_str(ident *id) { struct set_entry *entry = (struct set_entry*) id; return (const char*) entry->dptr; } -size_t get_id_strlen(const ident *id) +size_t get_id_strlen(ident *id) { struct set_entry *entry = (struct set_entry*) id; return entry->size; @@ -76,7 +76,7 @@ void finish_ident(void) id_set = NULL; } -int id_is_prefix(const ident *prefix, const ident *id) +int id_is_prefix(ident *prefix, ident *id) { size_t prefix_len = get_id_strlen(prefix); if (prefix_len > get_id_strlen(id)) @@ -84,7 +84,7 @@ int id_is_prefix(const ident *prefix, const ident *id) return 0 == memcmp(get_id_str(prefix), get_id_str(id), prefix_len); } -int id_is_suffix(const ident *suffix, const ident *id) +int id_is_suffix(ident *suffix, ident *id) { size_t suflen = get_id_strlen(suffix); size_t idlen = get_id_strlen(id); @@ -99,7 +99,7 @@ int id_is_suffix(const ident *suffix, const ident *id) return 0 == memcmp(get_id_str(suffix), part, suflen); } -int id_contains_char(const ident *id, char c) +int id_contains_char(ident *id, char c) { return strchr(get_id_str(id), c) != NULL; }