Index: asterisk.c =================================================================== RCS file: /usr/cvsroot/asterisk/asterisk.c,v retrieving revision 1.134 diff -u -r1.134 asterisk.c --- asterisk.c 31 Dec 2004 00:04:41 -0000 1.134 +++ asterisk.c 8 Jan 2005 22:07:52 -0000 @@ -730,7 +730,7 @@ ret = 1; } if ((strncasecmp(s, "quit", 4) == 0 || strncasecmp(s, "exit", 4) == 0) && - (s[4] == '\0' || isspace(s[4]))) { + (s[4] == '\0' || isspace((int)s[4]))) { quit_handler(0, 0, 0, 0); ret = 1; } @@ -1206,7 +1206,7 @@ ptr = (char *)lf->cursor; if (ptr) { while (ptr > lf->buffer) { - if (isspace(*ptr)) { + if (isspace((int)*ptr)) { ptr++; break; } @@ -1707,7 +1707,7 @@ exit(1); } if (setgid(gr->gr_gid)) { - ast_log(LOG_WARNING, "Unable to setgid to %d (%s)\n", gr->gr_gid, rungroup); + ast_log(LOG_WARNING, "Unable to setgid to %d (%s)\n", (int)gr->gr_gid, rungroup); exit(1); } if (option_verbose) @@ -1725,7 +1725,7 @@ exit(1); } if (setuid(pw->pw_uid)) { - ast_log(LOG_WARNING, "Unable to setuid to %d (%s)\n", pw->pw_uid, runuser); + ast_log(LOG_WARNING, "Unable to setuid to %d (%s)\n", (int)pw->pw_uid, runuser); exit(1); } if (option_verbose) @@ -1783,7 +1783,7 @@ unlink((char *)ast_config_AST_PID); f = fopen((char *)ast_config_AST_PID, "w"); if (f) { - fprintf(f, "%d\n", getpid()); + fprintf(f, "%d\n", (int)getpid()); fclose(f); } else ast_log(LOG_WARNING, "Unable to open pid file '%s': %s\n", (char *)ast_config_AST_PID, strerror(errno)); @@ -1794,7 +1794,7 @@ unlink((char *)ast_config_AST_PID); f = fopen((char *)ast_config_AST_PID, "w"); if (f) { - fprintf(f, "%d\n", getpid()); + fprintf(f, "%d\n", (int)getpid()); fclose(f); } else ast_log(LOG_WARNING, "Unable to open pid file '%s': %s\n", (char *)ast_config_AST_PID, strerror(errno)); Index: callerid.c =================================================================== RCS file: /usr/cvsroot/asterisk/callerid.c,v retrieving revision 1.26 diff -u -r1.26 callerid.c --- callerid.c 22 Oct 2004 19:45:39 -0000 1.26 +++ callerid.c 8 Jan 2005 22:07:52 -0000 @@ -189,20 +189,20 @@ for (i = 1; i < strlen(cidstring); i++ ) { if (cidstring[i] == 'C' || cidstring[i] == '#') break; - if (isdigit(cidstring[i])) + if (isdigit((int)cidstring[i])) number[i-1] = cidstring[i]; else ast_log(LOG_DEBUG, "Unknown CID digit '%c'\n", cidstring[i]); } number[i-1] = 0; - } else if (isdigit(cidstring[0])) { + } else if (isdigit((int)cidstring[0])) { /* It begins with a digit, so we parse it as a number and hope * for the best */ ast_log(LOG_WARNING, "Couldn't detect start-character. CID " "parsing might be unreliable\n"); for (i = 0; i < strlen(cidstring); i++) { - if (isdigit(cidstring[i])) + if (isdigit((int)cidstring[i])) number[i] = cidstring[i]; else break; Index: logger.c =================================================================== RCS file: /usr/cvsroot/asterisk/logger.c,v retrieving revision 1.54 diff -u -r1.54 logger.c --- logger.c 27 Dec 2004 22:41:58 -0000 1.54 +++ logger.c 8 Jan 2005 22:07:53 -0000 @@ -575,7 +575,7 @@ if (level == __LOG_EVENT) { va_start(ap, fmt); - fprintf(eventlog, "%s asterisk[%d]: ", date, getpid()); + fprintf(eventlog, "%s asterisk[%d]: ", date, (int)getpid()); vfprintf(eventlog, fmt, ap); fflush(eventlog); Index: mkpkgconfig =================================================================== RCS file: /usr/cvsroot/asterisk/mkpkgconfig,v retrieving revision 1.3 diff -u -r1.3 mkpkgconfig --- mkpkgconfig 14 Dec 2004 23:36:29 -0000 1.3 +++ mkpkgconfig 8 Jan 2005 22:07:53 -0000 @@ -15,12 +15,12 @@ ## Clean out CFLAGS for the spec file. -LOCAL_CFLAGS=$(echo $CFLAGS | sed -e 's/\s*-pipe\s*//g' | sed -e 's/-[Wmp]\S*\s*//g' | \ - sed -r -e 's/-I(include|\.\.\/include) //g' | - sed -e 's/-DINSTALL_PREFIX=\S* //g' | - sed -r -e 's/-DASTERISK_VERSION=\S* //g' | - sed -r -e 's/-DAST(ETCDIR|LIBDIR|VARLIBDIR|VARRUNDIR|SPOOLDIR|LOGDIR|CONFPATH|MODDIR|AGIDIR)=\S* //g' -) +LOCAL_CFLAGS=`echo $CFLAGS | sed -e 's/\s*-pipe\s*//g' | sed -e 's/-[Wmp]\S*\s*//g' | \ + sed -r -e 's/-I(include|\.\.\/include) //g' | \ + sed -e 's/-DINSTALL_PREFIX=\S* //g' | \ + sed -r -e 's/-DASTERISK_VERSION=\S* //g' | \ + sed -r -e 's/-DAST(ETCDIR|LIBDIR|VARLIBDIR|VARRUNDIR|SPOOLDIR|LOGDIR|CONFPATH|MODDIR|AGIDIR)=\S* //g'` + cat < $PPATH/asterisk.pc install_prefix=$INSTALL_PREFIX Index: pbx.c =================================================================== RCS file: /usr/cvsroot/asterisk/pbx.c,v retrieving revision 1.194 diff -u -r1.194 pbx.c --- pbx.c 1 Jan 2005 21:26:37 -0000 1.194 +++ pbx.c 8 Jan 2005 22:07:58 -0000 @@ -3215,7 +3215,7 @@ } *e = '\0'; e++; - while(*e && !isdigit(*e)) e++; + while(*e && !isdigit((int)*e)) e++; if (!*e) { ast_log(LOG_WARNING, "Invalid time range. Assuming no restrictions based on time.\n"); return; Index: rtp.c =================================================================== RCS file: /usr/cvsroot/asterisk/rtp.c,v retrieving revision 1.105 diff -u -r1.105 rtp.c --- rtp.c 7 Jan 2005 07:11:39 -0000 1.105 +++ rtp.c 8 Jan 2005 22:08:01 -0000 @@ -1169,11 +1169,9 @@ return 0; } -#ifdef SOLARIS +#if defined(SOLARIS) && defined(__sparc__) static void put_uint32(unsigned char *buf, int i) { - unsigned char *c = (unsigned char *)&i; - buf[0] = (i>>24) & 0xff; buf[1] = (i>>16) & 0xff; buf[2] = (i>>8) & 0xff; Index: strcompat.c =================================================================== RCS file: /usr/cvsroot/asterisk/strcompat.c,v retrieving revision 1.1 diff -u -r1.1 strcompat.c --- strcompat.c 14 Dec 2004 23:36:29 -0000 1.1 +++ strcompat.c 8 Jan 2005 22:08:01 -0000 @@ -2,6 +2,9 @@ #include #include +#ifdef SOLARIS +#include +#endif char* strsep(char** str, const char* delims) { @@ -142,3 +145,9 @@ return ret; } + +int unsetenv(const char *name) +{ + setenv(name,"",0); +} + Index: utils.c =================================================================== RCS file: /usr/cvsroot/asterisk/utils.c,v retrieving revision 1.25 diff -u -r1.25 utils.c --- utils.c 8 Jan 2005 18:54:30 -0000 1.25 +++ utils.c 8 Jan 2005 22:08:01 -0000 @@ -162,8 +162,9 @@ integers, we break with tradition and refuse to look up a pure integer */ s = host; + res = 0; while(s && *s) { - if (!isdigit(*s)) + if (!isdigit((int)*s)) break; s++; } Index: apps/app_adsiprog.c =================================================================== RCS file: /usr/cvsroot/asterisk/apps/app_adsiprog.c,v retrieving revision 1.9 diff -u -r1.9 app_adsiprog.c --- apps/app_adsiprog.c 26 Jul 2004 03:23:38 -0000 1.9 +++ apps/app_adsiprog.c 8 Jan 2005 22:08:02 -0000 @@ -198,7 +198,7 @@ /* Convert */ *((unsigned int *)out) = htonl(*((unsigned int *)out)); } - } else if ((!ast_strlen_zero(src) && isdigit(src[0]))) { + } else if ((!ast_strlen_zero(src) && isdigit((int)src[0]))) { if (!(argtype & ARG_NUMBER)) return -1; /* Hex value */ Index: apps/app_enumlookup.c =================================================================== RCS file: /usr/cvsroot/asterisk/apps/app_enumlookup.c,v retrieving revision 1.11 diff -u -r1.11 app_enumlookup.c --- apps/app_enumlookup.c 2 Oct 2004 00:58:31 -0000 1.11 +++ apps/app_enumlookup.c 8 Jan 2005 22:08:02 -0000 @@ -114,7 +114,7 @@ /* now copy over the number, skipping all non-digits and stop at ; or NULL */ t = tmp; while( *c && (*c != ';') && (t - tmp < (sizeof(tmp) - 1))) { - if (isdigit(*c)) + if (isdigit((int)*c)) *t++ = *c; c++; } Index: apps/app_sms.c =================================================================== RCS file: /usr/cvsroot/asterisk/apps/app_sms.c,v retrieving revision 1.16 diff -u -r1.16 app_sms.c --- apps/app_sms.c 19 Dec 2004 17:16:39 -0000 1.16 +++ apps/app_sms.c 8 Jan 2005 22:08:04 -0000 @@ -187,7 +187,7 @@ *d++ = *s++; while (*s) { - if (isdigit (*s)) + if (isdigit ((int)*s)) *d++ = *s; s++; } @@ -650,7 +650,7 @@ } else o[1] = 0x81; while (*i) - if (isdigit (*i)) + if (isdigit ((int)*i)) { if (o[0] & 1) o[p++] |= ((*i & 0xF) << 4); Index: apps/app_voicemail.c =================================================================== RCS file: /usr/cvsroot/asterisk/apps/app_voicemail.c,v retrieving revision 1.193 diff -u -r1.193 app_voicemail.c --- apps/app_voicemail.c 8 Jan 2005 19:00:46 -0000 1.193 +++ apps/app_voicemail.c 8 Jan 2005 22:08:09 -0000 @@ -1612,11 +1612,11 @@ fprintf(p, "Subject: New message %d in mailbox %s\n", msgnum + 1, mailbox); else fprintf(p, "Subject: [PBX]: New message %d in mailbox %s\n", msgnum + 1, mailbox); - fprintf(p, "Message-ID: \n", msgnum, (unsigned int)rand(), mailbox, getpid(), host); + fprintf(p, "Message-ID: \n", msgnum, (unsigned int)rand(), mailbox, (int)getpid(), host); fprintf(p, "MIME-Version: 1.0\n"); if (attach_user_voicemail) { /* Something unique. */ - snprintf(bound, sizeof(bound), "voicemail_%d%s%d%d", msgnum, mailbox, getpid(), (unsigned int)rand()); + snprintf(bound, sizeof(bound), "voicemail_%d%s%d%d", msgnum, mailbox, (int)getpid(), (unsigned int)rand()); fprintf(p, "Content-Type: multipart/mixed; boundary=\"%s\"\n\n\n", bound); Index: channels/chan_mgcp.c =================================================================== RCS file: /usr/cvsroot/asterisk/channels/chan_mgcp.c,v retrieving revision 1.103 diff -u -r1.103 chan_mgcp.c --- channels/chan_mgcp.c 6 Jan 2005 08:16:43 -0000 1.103 +++ channels/chan_mgcp.c 8 Jan 2005 22:08:14 -0000 @@ -1958,7 +1958,7 @@ ast_verbose("We're at %s port %d\n", ast_inet_ntoa(iabuf, sizeof(iabuf), p->parent->ourip), ntohs(sin.sin_port)); } snprintf(v, sizeof(v), "v=0\r\n"); - snprintf(o, sizeof(o), "o=root %d %d IN IP4 %s\r\n", getpid(), getpid(), ast_inet_ntoa(iabuf, sizeof(iabuf), dest.sin_addr)); + snprintf(o, sizeof(o), "o=root %d %d IN IP4 %s\r\n", (int)getpid(), (int)getpid(), ast_inet_ntoa(iabuf, sizeof(iabuf), dest.sin_addr)); snprintf(s, sizeof(s), "s=session\r\n"); snprintf(c, sizeof(c), "c=IN IP4 %s\r\n", ast_inet_ntoa(iabuf, sizeof(iabuf), dest.sin_addr)); snprintf(t, sizeof(t), "t=0 0\r\n"); Index: channels/chan_modem.c =================================================================== RCS file: /usr/cvsroot/asterisk/channels/chan_modem.c,v retrieving revision 1.33 diff -u -r1.33 chan_modem.c --- channels/chan_modem.c 14 Dec 2004 23:36:29 -0000 1.33 +++ channels/chan_modem.c 8 Jan 2005 22:08:15 -0000 @@ -797,7 +797,7 @@ strsep(&stringp, ":"); oldformat = format; - if (dev[0]=='g' && isdigit(dev[1])) { + if (dev[0]=='g' && isdigit((int)dev[1])) { /* Retrieve the group number */ if (sscanf(dev+1, "%u", &group) < 1) { ast_log(LOG_WARNING, "Unable to determine group from [%s]\n", (char *)data); Index: channels/chan_sip.c =================================================================== RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v retrieving revision 1.619 diff -u -r1.619 chan_sip.c --- channels/chan_sip.c 7 Jan 2005 21:35:50 -0000 1.619 +++ channels/chan_sip.c 8 Jan 2005 22:08:25 -0000 @@ -3643,7 +3643,7 @@ if( ( e= strrchr( req->rlPart2, 'S' ) ) == NULL ) { return -1; } - while( isspace( *(--e) ) ) {} + while( isspace( (int)*(--e) ) ) {} if( *e == '>' ) { *e= '\0'; } else { Index: channels/chan_zap.c =================================================================== RCS file: /usr/cvsroot/asterisk/channels/chan_zap.c,v retrieving revision 1.397 diff -u -r1.397 chan_zap.c --- channels/chan_zap.c 7 Jan 2005 21:18:00 -0000 1.397 +++ channels/chan_zap.c 8 Jan 2005 22:08:35 -0000 @@ -766,7 +766,7 @@ int x; isnum = 1; for (x=0;x #endif +#ifdef SOLARIS +#include +#endif + #include #include "hash.h" #include "page.h" Index: include/asterisk/channel.h =================================================================== RCS file: /usr/cvsroot/asterisk/include/asterisk/channel.h,v retrieving revision 1.69 diff -u -r1.69 channel.h --- include/asterisk/channel.h 8 Jan 2005 19:00:46 -0000 1.69 +++ include/asterisk/channel.h 8 Jan 2005 22:08:38 -0000 @@ -14,6 +14,9 @@ #ifndef _ASTERISK_CHANNEL_H #define _ASTERISK_CHANNEL_H +#ifdef SOLARIS +#include +#endif #include #include #include Index: include/asterisk/logger.h =================================================================== RCS file: /usr/cvsroot/asterisk/include/asterisk/logger.h,v retrieving revision 1.9 diff -u -r1.9 logger.h --- include/asterisk/logger.h 12 Feb 2004 22:11:02 -0000 1.9 +++ include/asterisk/logger.h 8 Jan 2005 22:08:38 -0000 @@ -13,7 +13,9 @@ #ifndef _LOGGER_H #define _LOGGER_H - +#ifdef SOLARIS +#include +#endif #include #if defined(__cplusplus) || defined(c_plusplus) Index: include/asterisk/utils.h =================================================================== RCS file: /usr/cvsroot/asterisk/include/asterisk/utils.h,v retrieving revision 1.15 diff -u -r1.15 utils.h --- include/asterisk/utils.h 8 Jan 2005 19:00:46 -0000 1.15 +++ include/asterisk/utils.h 8 Jan 2005 22:08:38 -0000 @@ -12,6 +12,9 @@ #ifndef _ASTERISK_UTIL_H #define _ASTERISK_UTIL_H +#ifdef SOLARIS +#include +#endif #include #include #include Index: include/solaris-compat/compat.h =================================================================== RCS file: /usr/cvsroot/asterisk/include/solaris-compat/compat.h,v retrieving revision 1.1 diff -u -r1.1 compat.h --- include/solaris-compat/compat.h 14 Dec 2004 23:36:30 -0000 1.1 +++ include/solaris-compat/compat.h 8 Jan 2005 22:08:38 -0000 @@ -8,18 +8,29 @@ #define __P(p) p #endif -#define LITTLE_ENDIAN 1234 -#define BIG_ENDIAN 4321 +#include +#include +#include +#include +#include +#include +#include -#define __LITTLE_ENDIAN 1234 -#define __BIG_ENDIAN 4321 +#ifndef BYTE_ORDER +#define LITTLE_ENDIAN 1234 +#define BIG_ENDIAN 4321 #ifdef __sparc__ -#define BYTE_ORDER BIG_ENDIAN -#define __BYTE_ORDER BIG_ENDIAN +#define BYTE_ORDER BIG_ENDIAN #else -#define BYTE_ORDER LITTLE_ENDIAN -#define ____BYTE_ORDER BIG_ENDIAN +#define BYTE_ORDER LITTLE_ENDIAN +#endif +#endif + +#ifndef __BYTE_ORDER +#define __LITTLE_ENDIAN LITTLE_ENDIAN +#define __BIG_ENDIAN BIG_ENDIAN +#define __BYTE_ORDER BYTE_ORDER #endif #ifndef __BIT_TYPES_DEFINED__ @@ -29,6 +40,9 @@ typedef unsigned int u_int32_t; #endif +char* strsep(char** str, const char* delims); +uint64_t +strtoq(const char *nptr, char **endptr, int base); int setenv(const char *name, const char *value, int overwrite); - +int unsetenv(const char *name); #endif Index: pbx/pbx_config.c =================================================================== RCS file: /usr/cvsroot/asterisk/pbx/pbx_config.c,v retrieving revision 1.51 diff -u -r1.51 pbx_config.c --- pbx/pbx_config.c 24 Oct 2004 02:53:24 -0000 1.51 +++ pbx/pbx_config.c 8 Jan 2005 22:08:40 -0000 @@ -394,7 +394,7 @@ */ if (strcmp("hint", c)) { while (*c != '\0') { - if (!isdigit(*c++)) { + if (!isdigit((int)*c++)) { ast_cli(fd, "Invalid priority '%s'\n", argv[3]); return RESULT_FAILURE; } Index: res/res_agi.c =================================================================== RCS file: /usr/cvsroot/asterisk/res/res_agi.c,v retrieving revision 1.23 diff -u -r1.23 res_agi.c --- res/res_agi.c 8 Jan 2005 19:35:20 -0000 1.23 +++ res/res_agi.c 8 Jan 2005 22:08:42 -0000 @@ -48,6 +48,9 @@ #include #include "../asterisk.h" #include "../astconf.h" +#ifdef SOLARIS +#include +#endif #define MAX_ARGS 128 #define MAX_COMMANDS 128 Index: res/res_indications.c =================================================================== RCS file: /usr/cvsroot/asterisk/res/res_indications.c,v retrieving revision 1.8 diff -u -r1.8 res_indications.c --- res/res_indications.c 18 Dec 2004 22:04:07 -0000 1.8 +++ res/res_indications.c 8 Jan 2005 22:08:42 -0000 @@ -253,7 +253,7 @@ ring = strsep(&c,","); while (ring) { int *tmp, val; - if (!isdigit(ring[0]) || (val=atoi(ring))==-1) { + if (!isdigit((int)ring[0]) || (val=atoi(ring))==-1) { ast_log(LOG_WARNING,"Invalid ringcadance given '%s' at line %d.\n",ring,v->lineno); ring = strsep(&c,","); continue; Index: utils/Makefile =================================================================== RCS file: /usr/cvsroot/asterisk/utils/Makefile,v retrieving revision 1.5 diff -u -r1.5 Makefile --- utils/Makefile 18 Dec 2004 13:38:15 -0000 1.5 +++ utils/Makefile 8 Jan 2005 22:08:43 -0000 @@ -12,6 +12,9 @@ TARGET+=$(shell if [ -f /usr/include/popt.h ]; then echo "smsq"; else if [ -f /usr/local/include/popt.h ]; then echo "smsq"; fi ; fi) TARGET+=$(shell if [ -f /usr/include/newt.h ]; then echo "astman"; else if [ -f /usr/local/include/newt.h ]; then echo "astman"; fi ; fi) +ifeq (${OSARCH},SunOS) +SOL=../strcompat.o +endif all: depend $(TARGET) @@ -31,7 +34,7 @@ $(CC) $(CFLAGS) -o astman astman.o ../md5.o -lnewt smsq: smsq.o - $(CC) $(CFLAGS) -o smsq smsq.o -lpopt + $(CC) $(CFLAGS) -o smsq ${SOL} smsq.o -lpopt ifneq ($(wildcard .depend),) include .depend Index: utils/smsq.c =================================================================== RCS file: /usr/cvsroot/asterisk/utils/smsq.c,v retrieving revision 1.3 diff -u -r1.3 smsq.c --- utils/smsq.c 19 Dec 2004 21:13:41 -0000 1.3 +++ utils/smsq.c 8 Jan 2005 22:08:43 -0000 @@ -9,6 +9,11 @@ #include #include #include +#ifdef SOLARIS +#include +#define POPT_ARGFLAG_SHOW_DEFAULT 0x00800000 +#endif + /* SMS queuing application for use with asterisk app_sms */ /* by Adrian Kennard, 2004 */ @@ -100,7 +105,7 @@ ql = p - queue; subaddress = p[1]; } - snprintf (temp, sizeof(temp), "sms/.smsq-%d", getpid ()); + snprintf (temp, sizeof(temp), "sms/.smsq-%d", (int)getpid ()); f = fopen (temp, "w"); if (!f) { @@ -170,7 +175,7 @@ DIR *d; int ql = strlen (queue); struct dirent *fn; - snprintf(temp, sizeof(temp), "sms/.smsq-%d", getpid ()); + snprintf(temp, sizeof(temp), "sms/.smsq-%d", (int)getpid ()); snprintf(dirname, sizeof(dirname), "sms/%s", dir); d = opendir (dirname); if (!d) @@ -647,10 +652,10 @@ queuename[100], *dir = (mo ? rx ? "sms/morx" : "sms/motx" : rx ? "sms/mtrx" : "sms/mttx"); FILE *f; - snprintf (temp, sizeof(temp), "sms/.smsq-%d", getpid ()); + snprintf (temp, sizeof(temp), "sms/.smsq-%d", (int)getpid ()); mkdir ("sms", 0777); /* ensure directory exists */ mkdir (dir, 0777); /* ensure directory exists */ - snprintf (queuename, sizeof(queuename), "%s/%s.%ld-%d", dir, *queue ? queue : "0", (long)time (0), getpid ()); + snprintf (queuename, sizeof(queuename), "%s/%s.%ld-%d", dir, *queue ? queue : "0", (long)time (0), (int)getpid ()); f = fopen (temp, "w"); if (!f) {