[asterisk-commits] file: branch 1.4 r77869 - in /branches/1.4: apps/ channels/ include/asterisk/...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Aug 1 12:56:59 CDT 2007


Author: file
Date: Wed Aug  1 12:56:59 2007
New Revision: 77869

URL: http://svn.digium.com/view/asterisk?view=rev&rev=77869
Log:
Add some fixes for building on Solaris.

Modified:
    branches/1.4/apps/app_voicemail.c
    branches/1.4/channels/chan_iax2.c
    branches/1.4/channels/chan_mgcp.c
    branches/1.4/include/asterisk/threadstorage.h
    branches/1.4/main/acl.c
    branches/1.4/utils/smsq.c

Modified: branches/1.4/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/apps/app_voicemail.c?view=diff&rev=77869&r1=77868&r2=77869
==============================================================================
--- branches/1.4/apps/app_voicemail.c (original)
+++ branches/1.4/apps/app_voicemail.c Wed Aug  1 12:56:59 2007
@@ -1906,7 +1906,7 @@
 		fprintf(p, "Subject: New message %d in mailbox %s" ENDL, msgnum + 1, mailbox);
 	else
 		fprintf(p, "Subject: [PBX]: New message %d in mailbox %s" ENDL, msgnum + 1, mailbox);
-	fprintf(p, "Message-ID: <Asterisk-%d-%d-%s-%d@%s>" ENDL, msgnum + 1, (unsigned int)ast_random(), mailbox, getpid(), host);
+	fprintf(p, "Message-ID: <Asterisk-%d-%d-%s-%d@%s>" ENDL, msgnum + 1, (unsigned int)ast_random(), mailbox, (int)getpid(), host);
 	if(imap) {
 		/* additional information needed for IMAP searching */
 		fprintf(p, "X-Asterisk-VM-Message-Num: %d" ENDL, msgnum + 1);
@@ -1931,7 +1931,7 @@
 	fprintf(p, "MIME-Version: 1.0" ENDL);
 	if (attach_user_voicemail) {
 		/* Something unique. */
-		snprintf(bound, sizeof(bound), "----voicemail_%d%s%d%d", msgnum + 1, mailbox, getpid(), (unsigned int)ast_random());
+		snprintf(bound, sizeof(bound), "----voicemail_%d%s%d%d", msgnum + 1, mailbox, (int)getpid(), (unsigned int)ast_random());
 
 		fprintf(p, "Content-Type: multipart/mixed; boundary=\"%s\"" ENDL, bound);
 		fprintf(p, ENDL ENDL "This is a multi-part message in MIME format." ENDL ENDL);

Modified: branches/1.4/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/chan_iax2.c?view=diff&rev=77869&r1=77868&r2=77869
==============================================================================
--- branches/1.4/channels/chan_iax2.c (original)
+++ branches/1.4/channels/chan_iax2.c Wed Aug  1 12:56:59 2007
@@ -1361,7 +1361,7 @@
 {
 	/* Close firmware */
 	if (cur->fwh) {
-		munmap(cur->fwh, ntohl(cur->fwh->datalen) + sizeof(*(cur->fwh)));
+		munmap((void*)cur->fwh, ntohl(cur->fwh->datalen) + sizeof(*(cur->fwh)));
 	}
 	close(cur->fd);
 	free(cur);
@@ -1460,7 +1460,7 @@
 		close(fd);
 		return -1;
 	}
-	fwh = mmap(NULL, stbuf.st_size, PROT_READ, MAP_PRIVATE, fd, 0); 
+	fwh = (struct ast_iax2_firmware_header*)mmap(NULL, stbuf.st_size, PROT_READ, MAP_PRIVATE, fd, 0); 
 	if (fwh == (void *) -1) {
 		ast_log(LOG_WARNING, "mmap failed: %s\n", strerror(errno));
 		close(fd);
@@ -1471,7 +1471,7 @@
 	MD5Final(sum, &md5);
 	if (memcmp(sum, fwh->chksum, sizeof(sum))) {
 		ast_log(LOG_WARNING, "Firmware file '%s' fails checksum\n", s);
-		munmap(fwh, stbuf.st_size);
+		munmap((void*)fwh, stbuf.st_size);
 		close(fd);
 		return -1;
 	}
@@ -1484,7 +1484,7 @@
 				break;
 			/* This version is no newer than what we have.  Don't worry about it.
 			   We'll consider it a proper load anyhow though */
-			munmap(fwh, stbuf.st_size);
+			munmap((void*)fwh, stbuf.st_size);
 			close(fd);
 			return 0;
 		}
@@ -1500,7 +1500,7 @@
 	}
 	if (cur) {
 		if (cur->fwh) {
-			munmap(cur->fwh, cur->mmaplen);
+			munmap((void*)cur->fwh, cur->mmaplen);
 		}
 		if (cur->fd > -1)
 			close(cur->fd);

Modified: branches/1.4/channels/chan_mgcp.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/chan_mgcp.c?view=diff&rev=77869&r1=77868&r2=77869
==============================================================================
--- branches/1.4/channels/chan_mgcp.c (original)
+++ branches/1.4/channels/chan_mgcp.c Wed Aug  1 12:56:59 2007
@@ -2050,7 +2050,7 @@
 		ast_verbose("We're at %s port %d\n", ast_inet_ntoa(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(dest.sin_addr));
+	snprintf(o, sizeof(o), "o=root %d %d IN IP4 %s\r\n", (int)getpid(), (int)getpid(), ast_inet_ntoa(dest.sin_addr));
 	snprintf(s, sizeof(s), "s=session\r\n");
 	snprintf(c, sizeof(c), "c=IN IP4 %s\r\n", ast_inet_ntoa(dest.sin_addr));
 	snprintf(t, sizeof(t), "t=0 0\r\n");

Modified: branches/1.4/include/asterisk/threadstorage.h
URL: http://svn.digium.com/view/asterisk/branches/1.4/include/asterisk/threadstorage.h?view=diff&rev=77869&r1=77868&r2=77869
==============================================================================
--- branches/1.4/include/asterisk/threadstorage.h (original)
+++ branches/1.4/include/asterisk/threadstorage.h Wed Aug  1 12:56:59 2007
@@ -43,6 +43,11 @@
 	void (*key_init)(void);
 };
 
+#ifdef SOLARIS
+#define THREADSTORAGE_ONCE_INIT {PTHREAD_ONCE_INIT}
+#else
+#define THREADSTORAGE_ONCE_INIT PTHREAD_ONCE_INIT
+#endif
 
 #if defined(DEBUG_THREADLOCALS)
 void __ast_threadstorage_object_add(void *key, size_t len, const char *file, const char *function, unsigned int line);
@@ -72,7 +77,7 @@
 #define AST_THREADSTORAGE_CUSTOM(name, name_init, cleanup)  \
 static void name_init(void);                                \
 static struct ast_threadstorage name = {                    \
-	.once = PTHREAD_ONCE_INIT,                          \
+	.once = THREADSTORAGE_ONCE_INIT,                    \
 	.key_init = name_init,                              \
 };                                                          \
 static void name_init(void)                                 \
@@ -83,7 +88,7 @@
 #define AST_THREADSTORAGE_CUSTOM(name, name_init, cleanup)  \
 static void name_init(void);                                \
 static struct ast_threadstorage name = {                    \
-	.once = PTHREAD_ONCE_INIT,                          \
+	.once = THREADSTORAGE_ONCE_INIT,                    \
 	.key_init = name_init,                              \
 };                                                          \
 static void __cleanup_##name(void *data)		    \

Modified: branches/1.4/main/acl.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/main/acl.c?view=diff&rev=77869&r1=77868&r2=77869
==============================================================================
--- branches/1.4/main/acl.c (original)
+++ branches/1.4/main/acl.c Wed Aug  1 12:56:59 2007
@@ -79,7 +79,7 @@
 };
 
 /* Default IP - if not otherwise set, don't breathe garbage */
-static struct in_addr __ourip = { 0x00000000 };
+static struct in_addr __ourip = { .s_addr = 0x00000000, };
 
 struct my_ifreq {
 	char ifrn_name[IFNAMSIZ];	/* Interface name, e.g. "eth0", "ppp0", etc.  */

Modified: branches/1.4/utils/smsq.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/utils/smsq.c?view=diff&rev=77869&r1=77868&r2=77869
==============================================================================
--- branches/1.4/utils/smsq.c (original)
+++ branches/1.4/utils/smsq.c Wed Aug  1 12:56:59 2007
@@ -125,7 +125,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)
    {
@@ -196,7 +196,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)
@@ -673,10 +673,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)
       {




More information about the asterisk-commits mailing list