1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-13 07:34:50 +00:00
freebsd-ports/audio/nas/files/patch-server_dia_gram.y
Vasil Dimov 924c483f27 Split patch-warnings into
patch-clients_audio_audemo_audemo.c
patch-clients_audio_auedit_Graph.c
patch-clients_audio_auedit_auedit.c
patch-clients_audio_aupanel_aupanel.c
patch-clients_audio_auphone_auphone.c
patch-clients_audio_autool_audiotool.c
patch-clients_audio_auwave_auwave.c
patch-server_dda_voxware_config.c
patch-server_dia_gram.y
patch-server_dia_lex.l
to ease with maintaining.
2006-05-20 07:56:48 +00:00

65 lines
1.5 KiB
Plaintext

--- server/dia/gram.y Mon Dec 22 21:00:04 2003
+++ server/dia/gram.y Mon Oct 10 10:46:03 2005
@@ -4,4 +4,5 @@
%{
+#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
@@ -15,5 +16,5 @@
static char *ptr;
-static int parsebool(char *str);
+static intptr_t parsebool(const char *str);
extern int yylineno;
@@ -22,5 +23,5 @@
%union
{
- int num;
+ intptr_t num;
char *ptr;
};
@@ -239,30 +240,21 @@
}
-static int parsebool(char *str)
+static intptr_t
+parsebool(const char *str)
{
- char *s;
-
- s = str;
-
- if (s == NULL)
+ if (str == NULL)
return(-1);
- while(*s)
- {
- *s = (char)tolower(*s);
- s++;
- }
-
- if (((char *)strstr("false", str) != NULL) ||
- ((char *)strstr("no", str) != NULL) ||
- ((char *)strstr("0", str) != NULL) ||
- ((char *)strstr("off", str) != NULL))
+ if (((char *)strcasestr("false", str) != NULL) ||
+ ((char *)strcasestr("no", str) != NULL) ||
+ ((char *)strcasestr("0", str) != NULL) ||
+ ((char *)strcasestr("off", str) != NULL))
{
return(FALSE);
}
- else if (((char *)strstr("true", str) != NULL) ||
- ((char *)strstr("yes", str) != NULL) ||
- ((char *)strstr("1", str) != NULL) ||
- ((char *)strstr("on", str) != NULL))
+ else if (((char *)strcasestr("true", str) != NULL) ||
+ ((char *)strcasestr("yes", str) != NULL) ||
+ ((char *)strcasestr("1", str) != NULL) ||
+ ((char *)strcasestr("on", str) != NULL))
{
return(TRUE);