[asterisk-commits] seanbright: branch group/asterisk-cpp r168492 - /team/group/asterisk-cpp/utils/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Jan 12 09:39:45 CST 2009
Author: seanbright
Date: Mon Jan 12 09:39:45 2009
New Revision: 168492
URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=168492
Log:
The utils build now, but they don't link.
Modified:
team/group/asterisk-cpp/utils/frame.c
team/group/asterisk-cpp/utils/frame.h
team/group/asterisk-cpp/utils/muted.c
Modified: team/group/asterisk-cpp/utils/frame.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/utils/frame.c?view=diff&rev=168492&r1=168491&r2=168492
==============================================================================
--- team/group/asterisk-cpp/utils/frame.c (original)
+++ team/group/asterisk-cpp/utils/frame.c Mon Jan 12 09:39:45 2009
@@ -31,14 +31,14 @@
int wavout; /* TRUE iff out file should be a .WAV file */
int iswav; /* TRUE iff in file was found to be a .WAV file */
FILE *in, *out;
-char *infilename, *outfilename;
+const char *infilename, *outfilename;
int verboselevel;
-char *version = "";
-char *usage = "";
+const char *version = "";
+const char *usage = "";
static int test_usage;
-static char *standardversion = "frame version 1.3, June 13th 2001";
-static char *standardusage =
+static const char *standardversion = "frame version 1.3, June 13th 2001";
+static const char *standardusage =
"\nOptions common to all mark-dsp programs:\n"
"-h \t\t create a WAV-header on output files.\n"
@@ -431,7 +431,7 @@
* it is either no dash followed by something, *
* or it is a dash following by nothing. *
*---------------------------------------------*/
- result = malloc( strlen( args[i]) + 1);
+ result = (char *) malloc( strlen( args[i]) + 1);
if (result == NULL)
fatalperror( "Couldn't allocate memory for filename\n");
strcpy( result, args[i]);
@@ -454,7 +454,7 @@
return FALSE;
}
-int parseswitcharg( int argcount, char *args[], char *string)
+int parseswitcharg( int argcount, char *args[], const char *string)
{
int i;
@@ -468,7 +468,7 @@
return FALSE;
}
-int parseintarg( int argcount, char *args[], char *string, int *result)
+int parseintarg( int argcount, char *args[], const char *string, int *result)
{
int i, temp;
char c;
@@ -634,7 +634,7 @@
-------------------------------------------------------------------- */
void argerrornum(const char *s, Errornum code)
{
- char *message;
+ const char *message;
if (code == ME_TOOMANYFILES)
{
@@ -897,7 +897,7 @@
which begins with the label 's'. If there is none, -1.
We also mark that option as done with, i.e. we cross it out.
-------------------------------------------------------------------- */
-int findoption( int argcount, char *args[], char *s)
+int findoption( int argcount, char *args[], const char *s)
{
int i;
@@ -947,7 +947,7 @@
int length, nowlength;
length = BUFFSIZE;
- if ((buffer = malloc( sizeof(short) * length)) == NULL)
+ if ((buffer = (short *) malloc( sizeof(short) * length)) == NULL)
fatalperror ("");
while (TRUE)
{
@@ -1039,7 +1039,7 @@
{
char *result;
- result = malloc( strlen( string) + 1);
+ result = (char *) malloc( strlen( string) + 1);
if (result != NULL)
strcpy( result, string);
return result;
@@ -1050,7 +1050,7 @@
{
char *result;
- result = malloc( strlen( one) + strlen( two) + 1);
+ result = (char *) malloc( strlen( one) + strlen( two) + 1);
if (result != NULL)
{
strcpy( result, one);
@@ -1071,7 +1071,7 @@
short *buffer;
int samplesread, count;
- buffer = malloc( sizeof( *buffer) * BUFFSIZE);
+ buffer = (short *) malloc( sizeof( *buffer) * BUFFSIZE);
if (buffer == NULL) fatalperror("Couldn't allocate buffer");
while (size > 0)
Modified: team/group/asterisk-cpp/utils/frame.h
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/utils/frame.h?view=diff&rev=168492&r1=168491&r2=168492
==============================================================================
--- team/group/asterisk-cpp/utils/frame.h (original)
+++ team/group/asterisk-cpp/utils/frame.h Mon Jan 12 09:39:45 2009
@@ -252,7 +252,7 @@
which begins with the label 's'. If there is none, -1.
We also mark that option as done with, i.e. we cross it out.
-------------------------------------------------------------------- */
-extern int findoption( int argcount, char *args[], char *s);
+extern int findoption( int argcount, char *args[], const char *s);
/* --------------------------------------------------------------------
Finishes off the .WAV header (if any) and exits correctly and formerly.
Modified: team/group/asterisk-cpp/utils/muted.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/utils/muted.c?view=diff&rev=168492&r1=168491&r2=168492
==============================================================================
--- team/group/asterisk-cpp/utils/muted.c (original)
+++ team/group/asterisk-cpp/utils/muted.c Mon Jan 12 09:39:45 2009
@@ -54,7 +54,7 @@
#include <netinet/in.h>
#include <arpa/inet.h>
-static char *config = "/etc/muted.conf";
+static const char *config = "/etc/muted.conf";
static char host[256] = "";
static char user[256] = "";
@@ -84,7 +84,7 @@
static void add_channel(char *tech, char *location)
{
struct channel *chan;
- chan = malloc(sizeof(struct channel));
+ chan = (struct channel *) malloc(sizeof(struct channel));
if (chan) {
memset(chan, 0, sizeof(struct channel));
if (!(chan->tech = strdup(tech))) {
@@ -558,7 +558,7 @@
return;
sub = sub->next;
}
- sub = malloc(sizeof(struct subchannel));
+ sub = (struct subchannel *) malloc(sizeof(struct subchannel));
if (sub) {
memset(sub, 0, sizeof(struct subchannel));
if (!(sub->name = strdup(name))) {
More information about the asterisk-commits
mailing list