[Asterisk-cvs] asterisk/formats format_pcm.c, 1.16, 1.17 format_pcm_alaw.c, 1.14, 1.15 format_wav.c, 1.20, 1.21

markster at lists.digium.com markster at lists.digium.com
Sat Dec 18 17:07:57 CST 2004


Update of /usr/cvsroot/asterisk/formats
In directory mongoose.digium.com:/tmp/cvs-serv20470/formats

Modified Files:
	format_pcm.c format_pcm_alaw.c format_wav.c 
Log Message:
Fix comment issues (bug #3089)


Index: format_pcm.c
===================================================================
RCS file: /usr/cvsroot/asterisk/formats/format_pcm.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- format_pcm.c	14 Dec 2004 23:36:30 -0000	1.16
+++ format_pcm.c	18 Dec 2004 22:04:06 -0000	1.17
@@ -177,7 +177,7 @@
 	if (whence != SEEK_FORCECUR) {
 		offset = (offset > max)?max:offset;
 	}
-	// always protect against seeking past begining.
+	/* always protect against seeking past begining. */
 	offset = (offset < min)?min:offset;
 	return lseek(fs->fd, offset, SEEK_SET);
 }

Index: format_pcm_alaw.c
===================================================================
RCS file: /usr/cvsroot/asterisk/formats/format_pcm_alaw.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- format_pcm_alaw.c	14 Dec 2004 23:36:30 -0000	1.14
+++ format_pcm_alaw.c	18 Dec 2004 22:04:06 -0000	1.15
@@ -3,9 +3,9 @@
  *
  * Flat, binary, alaw PCM file format.
  * 
- * Copyright (C) 1999, Mark Spencer
+ * Copyright (C) 1999, Digium, inc
  *
- * Mark Spencer <markster at linux-support.net>
+ * Mark Spencer <markster at digium.com>
  *
  * This program is free software, distributed under the terms of
  * the GNU General Public License
@@ -39,7 +39,7 @@
 
 #define BUF_SIZE 160		/* 160 samples */
 
-// #define REALTIME_WRITE
+/* #define REALTIME_WRITE */
 
 struct ast_filestream {
 	void *reserved[AST_RESERVED_POINTERS];
@@ -192,18 +192,19 @@
 
 #ifdef REALTIME_WRITE
 	cur_time = get_time();
-	fpos = ( cur_time - fs->start_time ) * 8;	// 8 bytes per msec
-	// Check if we have written to this position yet. If we have, then increment pos by one frame
-	// for some degree of protection against receiving packets in the same clock tick.
+	fpos = ( cur_time - fs->start_time ) * 8;	/* 8 bytes per msec */
+	/* Check if we have written to this position yet. If we have, then increment pos by one frame
+	*  for some degree of protection against receiving packets in the same clock tick.
+	*/
 	fstat( fs->fd, &stat_buf );
 	if( stat_buf.st_size > fpos )
 	{
-		fpos += f->datalen;	// Incrementing with the size of this current frame
+		fpos += f->datalen;	/* Incrementing with the size of this current frame */
 	}
 
 	if( stat_buf.st_size < fpos )
 	{
-		// fill the gap with 0x55 rather than 0.
+		/* fill the gap with 0x55 rather than 0. */
 		char buf[ 512 ];
 		unsigned long cur, to_write;
 
@@ -232,7 +233,7 @@
 		ast_log( LOG_WARNING, "Cannot seek in file: %s\n", strerror(errno) );
 		return -1;
 	}
-#endif	// REALTIME_WRITE
+#endif	/* REALTIME_WRITE */
 	
 	if ((res = write(fs->fd, f->data, f->datalen)) != f->datalen) {
 			ast_log(LOG_WARNING, "Bad write (%d/%d): %s\n", res, f->datalen, strerror(errno));
@@ -257,7 +258,7 @@
 	if (whence != SEEK_FORCECUR) {
 		offset = (offset > max)?max:offset;
 	}
-	// Always protect against seeking past begining
+	/* Always protect against seeking past begining */
 	offset = (offset < min)?min:offset;
 	return lseek(fs->fd, offset, SEEK_SET);
 }

Index: format_wav.c
===================================================================
RCS file: /usr/cvsroot/asterisk/formats/format_wav.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- format_wav.c	14 Dec 2004 23:36:30 -0000	1.20
+++ format_wav.c	18 Dec 2004 22:04:06 -0000	1.21
@@ -177,12 +177,12 @@
 		ast_log(LOG_WARNING, "Read failed (Bits Per Sample): %d\n", ltohs(bisam));
 		return -1;
 	}
-	// Skip any additional header
+	/* Skip any additional header */
 	if ( lseek(fd,ltohl(hsize)-16,SEEK_CUR) == -1 ) {
 		ast_log(LOG_WARNING, "Failed to skip remaining header bytes: %d\n", ltohl(hsize)-16 );
 		return -1;
 	}
-	// Skip any facts and get the first data block
+	/* Skip any facts and get the first data block */
 	for(;;)
 	{ 
             char buf[4];
@@ -529,7 +529,7 @@
         if (whence != SEEK_FORCECUR) {
 		offset = (offset > max)?max:offset;
 	}
-	// always protect the header space.
+	/* always protect the header space. */
 	offset = (offset < min)?min:offset;
 	return lseek(fs->fd,offset,SEEK_SET);
 }




More information about the svn-commits mailing list