mirror of
https://github.com/zint/zint
synced 2024-11-16 20:57:25 +13:00
Ticket #18: add some const.
This commit is contained in:
parent
5ec95153a0
commit
0fcf4cc1ab
@ -73,7 +73,7 @@ void to_upper(unsigned char source[]) {
|
||||
}
|
||||
|
||||
/* Verifies that a string only uses valid characters */
|
||||
int is_sane(char test_string[], const unsigned char source[], const int length) {
|
||||
int is_sane(const char test_string[], const unsigned char source[], const int length) {
|
||||
unsigned int i, j, latch;
|
||||
unsigned int lt = strlen(test_string);
|
||||
|
||||
@ -94,7 +94,7 @@ int is_sane(char test_string[], const unsigned char source[], const int length)
|
||||
}
|
||||
|
||||
/* Returns the position of data in set_string */
|
||||
int posn(char set_string[], const char data) {
|
||||
int posn(const char set_string[], const char data) {
|
||||
unsigned int i, n = strlen(set_string);
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
@ -106,7 +106,7 @@ int posn(char set_string[], const char data) {
|
||||
}
|
||||
|
||||
/* Replaces huge switch statements for looking up in tables */
|
||||
void lookup(char set_string[], const char *table[], const char data, char dest[]) {
|
||||
void lookup(const char set_string[], const char *table[], const char data, char dest[]) {
|
||||
unsigned int i, n = strlen(set_string);
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
@ -132,7 +132,7 @@ void unset_module(struct zint_symbol *symbol, const int y_coord, const int x_coo
|
||||
}
|
||||
|
||||
/* Expands from a width pattern to a bit pattern */
|
||||
void expand(struct zint_symbol *symbol, char data[]) {
|
||||
void expand(struct zint_symbol *symbol, const char data[]) {
|
||||
|
||||
unsigned int reader, n = strlen(data);
|
||||
int writer, i;
|
||||
|
@ -56,10 +56,10 @@ extern "C" {
|
||||
extern int ctoi(const char source);
|
||||
extern char itoc(const int source);
|
||||
extern void to_upper(unsigned char source[]);
|
||||
extern int is_sane(char test_string[], const unsigned char source[], const int length);
|
||||
extern void lookup(char set_string[], const char *table[], const char data, char dest[]);
|
||||
extern int posn(char set_string[], const char data);
|
||||
extern void expand(struct zint_symbol *symbol, char data[]);
|
||||
extern int is_sane(const char test_string[], const unsigned char source[], const int length);
|
||||
extern void lookup(const char set_string[], const char *table[], const char data, char dest[]);
|
||||
extern int posn(const char set_string[], const char data);
|
||||
extern void expand(struct zint_symbol *symbol, const char data[]);
|
||||
extern int is_stackable(const int symbology);
|
||||
extern int is_extendable(const int symbology);
|
||||
extern int roundup(const float input);
|
||||
|
@ -1099,7 +1099,7 @@ int ZBarcode_Encode_File_and_Buffer(struct zint_symbol *symbol, char *filename,
|
||||
* dimensions. The symbol->scale and symbol->height values are totally ignored in this case.
|
||||
*
|
||||
*/
|
||||
int ZBarcode_Render(struct zint_symbol *symbol, float width, float height) {
|
||||
int ZBarcode_Render(struct zint_symbol *symbol, const float width, const float height) {
|
||||
// Send the request to the render_plot method
|
||||
return render_plot(symbol, width, height);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user