diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-11-11 10:51:12 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-11-11 10:51:12 +0300 |
commit | 030253cdf665648eb5a16f3be910ceae26979f30 (patch) | |
tree | 1c6f2732bd77840c6056c11d788bf786bdf39299 /source/blender/blenfont/intern | |
parent | 80a650dfb1e73363ae6924dc5738b732bb89ded4 (diff) |
fix for building, also use const char in more places.
Diffstat (limited to 'source/blender/blenfont/intern')
-rw-r--r-- | source/blender/blenfont/intern/blf.c | 24 | ||||
-rw-r--r-- | source/blender/blenfont/intern/blf_dir.c | 4 | ||||
-rw-r--r-- | source/blender/blenfont/intern/blf_font.c | 14 | ||||
-rw-r--r-- | source/blender/blenfont/intern/blf_internal.h | 16 |
4 files changed, 29 insertions, 29 deletions
diff --git a/source/blender/blenfont/intern/blf.c b/source/blender/blenfont/intern/blf.c index 70755ee1f82..360c79ed06a 100644 --- a/source/blender/blenfont/intern/blf.c +++ b/source/blender/blenfont/intern/blf.c @@ -99,7 +99,7 @@ void BLF_exit(void) blf_font_exit(); } -static int blf_search(char *name) +static int blf_search(const char *name) { FontBLF *font; int i; @@ -112,7 +112,7 @@ static int blf_search(char *name) return(-1); } -int BLF_load(char *name) +int BLF_load(const char *name) { FontBLF *font; char *filename; @@ -153,7 +153,7 @@ int BLF_load(char *name) return(i); } -int BLF_load_unique(char *name) +int BLF_load_unique(const char *name) { FontBLF *font; char *filename; @@ -199,7 +199,7 @@ void BLF_metrics_attach(int fontid, unsigned char *mem, int mem_size) blf_font_attach_from_mem(font, mem, mem_size); } -int BLF_load_mem(char *name, unsigned char *mem, int mem_size) +int BLF_load_mem(const char *name, unsigned char *mem, int mem_size) { FontBLF *font; int i; @@ -235,7 +235,7 @@ int BLF_load_mem(char *name, unsigned char *mem, int mem_size) return(i); } -int BLF_load_mem_unique(char *name, unsigned char *mem, int mem_size) +int BLF_load_mem_unique(const char *name, unsigned char *mem, int mem_size) { FontBLF *font; int i; @@ -452,7 +452,7 @@ void BLF_draw_ascii(int fontid, const char *str, size_t len) } } -void BLF_boundbox(int fontid, char *str, rctf *box) +void BLF_boundbox(int fontid, const char *str, rctf *box) { FontBLF *font; @@ -461,7 +461,7 @@ void BLF_boundbox(int fontid, char *str, rctf *box) blf_font_boundbox(font, str, box); } -void BLF_width_and_height(int fontid, char *str, float *width, float *height) +void BLF_width_and_height(int fontid, const char *str, float *width, float *height) { FontBLF *font; @@ -470,7 +470,7 @@ void BLF_width_and_height(int fontid, char *str, float *width, float *height) blf_font_width_and_height(font, str, width, height); } -float BLF_width(int fontid, char *str) +float BLF_width(int fontid, const char *str) { FontBLF *font; @@ -490,7 +490,7 @@ float BLF_fixed_width(int fontid) return(0.0f); } -float BLF_width_default(char *str) +float BLF_width_default(const char *str) { float width; @@ -507,7 +507,7 @@ float BLF_width_default(char *str) return(width); } -float BLF_height(int fontid, char *str) +float BLF_height(int fontid, const char *str) { FontBLF *font; @@ -517,7 +517,7 @@ float BLF_height(int fontid, char *str) return(0.0f); } -float BLF_height_default(char *str) +float BLF_height_default(const char *str) { float height; @@ -621,7 +621,7 @@ void BLF_buffer_col(int fontid, float r, float g, float b, float a) } } -void BLF_draw_buffer(int fontid, char *str) +void BLF_draw_buffer(int fontid, const char *str) { FontBLF *font; diff --git a/source/blender/blenfont/intern/blf_dir.c b/source/blender/blenfont/intern/blf_dir.c index e650586aa9c..1eb7597fa54 100644 --- a/source/blender/blenfont/intern/blf_dir.c +++ b/source/blender/blenfont/intern/blf_dir.c @@ -121,7 +121,7 @@ void BLF_dir_free(char **dirs, int count) MEM_freeN(dirs); } -char *blf_dir_search(char *file) +char *blf_dir_search(const char *file) { DirBLF *dir; char full_path[FILE_MAXDIR+FILE_MAXFILE]; @@ -175,7 +175,7 @@ int blf_dir_split(const char *str, char *file, int *size) /* Some font have additional file with metrics information, * in general, the extension of the file is: .afm or .pfm */ -char *blf_dir_metrics_search(char *filename) +char *blf_dir_metrics_search(const char *filename) { char *mfile; char *s; diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c index 7542d200be1..1ae654cc5bc 100644 --- a/source/blender/blenfont/intern/blf_font.c +++ b/source/blender/blenfont/intern/blf_font.c @@ -205,7 +205,7 @@ void blf_font_draw_ascii(FontBLF *font, const char *str, unsigned int len) } } -void blf_font_buffer(FontBLF *font, char *str) +void blf_font_buffer(FontBLF *font, const char *str) { unsigned char *cbuf; unsigned int c; @@ -339,7 +339,7 @@ void blf_font_buffer(FontBLF *font, char *str) } } -void blf_font_boundbox(FontBLF *font, char *str, rctf *box) +void blf_font_boundbox(FontBLF *font, const char *str, rctf *box) { unsigned int c; GlyphBLF *g, *g_prev; @@ -418,7 +418,7 @@ void blf_font_boundbox(FontBLF *font, char *str, rctf *box) } } -void blf_font_width_and_height(FontBLF *font, char *str, float *width, float *height) +void blf_font_width_and_height(FontBLF *font, const char *str, float *width, float *height) { rctf box; @@ -429,7 +429,7 @@ void blf_font_width_and_height(FontBLF *font, char *str, float *width, float *he } } -float blf_font_width(FontBLF *font, char *str) +float blf_font_width(FontBLF *font, const char *str) { rctf box; @@ -440,7 +440,7 @@ float blf_font_width(FontBLF *font, char *str) return((box.xmax - box.xmin) * font->aspect); } -float blf_font_height(FontBLF *font, char *str) +float blf_font_height(FontBLF *font, const char *str) { rctf box; @@ -523,7 +523,7 @@ static void blf_font_fill(FontBLF *font) memset(font->glyph_ascii_table, 0, sizeof(font->glyph_ascii_table)); } -FontBLF *blf_font_new(char *name, char *filename) +FontBLF *blf_font_new(const char *name, const char *filename) { FontBLF *font; FT_Error err; @@ -566,7 +566,7 @@ void blf_font_attach_from_mem(FontBLF *font, const unsigned char *mem, int mem_s FT_Attach_Stream(font->face, &open); } -FontBLF *blf_font_new_from_mem(char *name, unsigned char *mem, int mem_size) +FontBLF *blf_font_new_from_mem(const char *name, unsigned char *mem, int mem_size) { FontBLF *font; FT_Error err; diff --git a/source/blender/blenfont/intern/blf_internal.h b/source/blender/blenfont/intern/blf_internal.h index ec52a1728f4..bded1feb9bb 100644 --- a/source/blender/blenfont/intern/blf_internal.h +++ b/source/blender/blenfont/intern/blf_internal.h @@ -33,24 +33,24 @@ unsigned int blf_hash(unsigned int val); int blf_utf8_next(unsigned char *buf, int *iindex); char *blf_dir_search(const char *file); -char *blf_dir_metrics_search(char *filename); +char *blf_dir_metrics_search(const char *filename); int blf_dir_split(const char *str, char *file, int *size); int blf_font_init(void); void blf_font_exit(void); -FontBLF *blf_font_new(char *name, char *filename); -FontBLF *blf_font_new_from_mem(char *name, unsigned char *mem, int mem_size); +FontBLF *blf_font_new(const char *name, const char *filename); +FontBLF *blf_font_new_from_mem(const char *name, unsigned char *mem, int mem_size); void blf_font_attach_from_mem(FontBLF *font, const unsigned char *mem, int mem_size); void blf_font_size(FontBLF *font, int size, int dpi); void blf_font_draw(FontBLF *font, const char *str, unsigned int len); void blf_font_draw_ascii(FontBLF *font, const char *str, unsigned int len); -void blf_font_buffer(FontBLF *font, char *str); -void blf_font_boundbox(FontBLF *font, char *str, rctf *box); -void blf_font_width_and_height(FontBLF *font, char *str, float *width, float *height); -float blf_font_width(FontBLF *font, char *str); -float blf_font_height(FontBLF *font, char *str); +void blf_font_buffer(FontBLF *font, const char *str); +void blf_font_boundbox(FontBLF *font, const char *str, rctf *box); +void blf_font_width_and_height(FontBLF *font, const char *str, float *width, float *height); +float blf_font_width(FontBLF *font, const char *str); +float blf_font_height(FontBLF *font, const char *str); float blf_font_fixed_width(FontBLF *font); void blf_font_free(FontBLF *font); |