constipate the "str" argument to bsi() and bsii()

The string argument to bsi() and bsii() should be const.
This commit is contained in:
H. Peter Anvin 2007-11-08 19:15:33 -08:00
parent 5fbbc8c2e7
commit c84f1b927b
2 changed files with 4 additions and 4 deletions

View file

@ -785,7 +785,7 @@ const char *prefix_name(int token)
/*
* Binary search.
*/
int bsi(char *string, const char **array, int size)
int bsi(const char *string, const char **array, int size)
{
int i = -1, j = size; /* always, i < index < j */
while (j - i >= 2) {
@ -801,7 +801,7 @@ int bsi(char *string, const char **array, int size)
return -1; /* we haven't got it :( */
}
int bsii(char *string, const char **array, int size)
int bsii(const char *string, const char **array, int size)
{
int i = -1, j = size; /* always, i < index < j */
while (j - i >= 2) {

View file

@ -304,8 +304,8 @@ void saa_fpwrite(struct SAA *, FILE *);
*
* bsi() is case sensitive, bsii() is case insensitive.
*/
int bsi(char *string, const char **array, int size);
int bsii(char *string, const char **array, int size);
int bsi(const char *string, const char **array, int size);
int bsii(const char *string, const char **array, int size);
char *src_set_fname(char *newname);
int32_t src_set_linnum(int32_t newline);