[asterisk-commits] kharwell: branch 1.8 r404742 - in /branches/1.8: apps/ channels/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jan 3 12:18:25 CST 2014


Author: kharwell
Date: Fri Jan  3 12:18:22 2014
New Revision: 404742

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=404742
Log:
chan_unistim.c, app_meetme: compiler warnings

Fixed a couple of compiler warnings (errors in 'dev-mode') given by gcc
version 4.8.1. The one in app_meetme involved the 'sizeof-pointer-memaccess'
(see: http://gcc.gnu.org/gcc-4.8/porting_to.html) warning. The one in
chan_unistim was issuing an array out of bounds message. Fixed both so
they would no longer issue warnings and can compile again in 'dev-mode'.

Review: https://reviewboard.asterisk.org/r/3098/

Modified:
    branches/1.8/apps/app_meetme.c
    branches/1.8/channels/chan_unistim.c

Modified: branches/1.8/apps/app_meetme.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/apps/app_meetme.c?view=diff&rev=404742&r1=404741&r2=404742
==============================================================================
--- branches/1.8/apps/app_meetme.c (original)
+++ branches/1.8/apps/app_meetme.c Fri Jan  3 12:18:22 2014
@@ -2547,7 +2547,7 @@
  * \param recordingtmp character buffer which may hold the name of the conference recording file
  * \param dahdic dahdi configuration info used by the main conference loop
  */
-static void meetme_menu_admin_extended(enum menu_modes *menu_mode, int *dtmf, struct ast_conference *conf, struct ast_flags64 *confflags, struct ast_channel *chan, struct ast_conf_user *user, char *recordingtmp, struct dahdi_confinfo *dahdic)
+static void meetme_menu_admin_extended(enum menu_modes *menu_mode, int *dtmf, struct ast_conference *conf, struct ast_flags64 *confflags, struct ast_channel *chan, struct ast_conf_user *user, char *recordingtmp, int recordingtmp_size, struct dahdi_confinfo *dahdic)
 {
 	int keepplaying;
 	int playednamerec;
@@ -2668,7 +2668,7 @@
 				}
 				ast_channel_unlock(chan);
 				if (!conf->recordingfilename) {
-					snprintf(recordingtmp, sizeof(recordingtmp), "meetme-conf-rec-%s-%s", conf->confno, chan->uniqueid);
+					snprintf(recordingtmp, recordingtmp_size, "meetme-conf-rec-%s-%s", conf->confno, chan->uniqueid);
 					conf->recordingfilename = ast_strdup(recordingtmp);
 				}
 				if (!conf->recordingformat) {
@@ -2731,7 +2731,7 @@
  * \param dahdic dahdi configuration info used by the main conference loop
  */
 
-static void meetme_menu(enum menu_modes *menu_mode, int *dtmf, struct ast_conference *conf, struct ast_flags64 *confflags, struct ast_channel *chan, struct ast_conf_user *user, char *recordingtmp, struct dahdi_confinfo *dahdic)
+static void meetme_menu(enum menu_modes *menu_mode, int *dtmf, struct ast_conference *conf, struct ast_flags64 *confflags, struct ast_channel *chan, struct ast_conf_user *user, char *recordingtmp, int recordingtmp_size, struct dahdi_confinfo *dahdic)
 {
 	switch (*menu_mode) {
 	case MENU_DISABLED:
@@ -2746,7 +2746,7 @@
 			break;
 		}
 	case MENU_ADMIN_EXTENDED:
-		meetme_menu_admin_extended(menu_mode, dtmf, conf, confflags, chan, user, recordingtmp, dahdic);
+		meetme_menu_admin_extended(menu_mode, dtmf, conf, confflags, chan, user, recordingtmp, recordingtmp_size, dahdic);
 		break;
 	}
 }
@@ -3791,7 +3791,7 @@
 					}
 
 					if (dtmf > 0) {
-						meetme_menu(&menu_mode, &dtmf, conf, confflags, chan, user, recordingtmp, &dahdic);
+						meetme_menu(&menu_mode, &dtmf, conf, confflags, chan, user, recordingtmp, sizeof(recordingtmp), &dahdic);
 					}
 
 					if (musiconhold && !menu_mode) {

Modified: branches/1.8/channels/chan_unistim.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/channels/chan_unistim.c?view=diff&rev=404742&r1=404741&r2=404742
==============================================================================
--- branches/1.8/channels/chan_unistim.c (original)
+++ branches/1.8/channels/chan_unistim.c Fri Jan  3 12:18:22 2014
@@ -2693,7 +2693,7 @@
 	}
 	if ((keycode >= KEY_0) && (keycode <= KEY_SHARP)) {
 		char tmpbuf[] = "Number : ...............";
-		int i = 0;
+		unsigned int i = 0; /* changed to unsigned due to weird gcc 4.8.1 compiler complaint */
 
 		if (pte->device->size_phone_number >= 15)
 			return;




More information about the asterisk-commits mailing list