[Freeswitch-svn] [commit] r10948 - in freeswitch/trunk/libs/esl: . src

FreeSWITCH SVN mikej at freeswitch.org
Fri Dec 26 09:07:05 PST 2008


Author: mikej
Date: Fri Dec 26 12:07:05 2008
New Revision: 10948

Log:
fix build

Modified:
   freeswitch/trunk/libs/esl/fs_cli.c
   freeswitch/trunk/libs/esl/src/esl.c

Modified: freeswitch/trunk/libs/esl/fs_cli.c
==============================================================================
--- freeswitch/trunk/libs/esl/fs_cli.c	(original)
+++ freeswitch/trunk/libs/esl/fs_cli.c	Fri Dec 26 12:07:05 2008
@@ -41,15 +41,15 @@
 }
 
 
-#ifdef WIN32
-static HANDLE hStdout;
-static WORD wOldColorAttrs;
-static CONSOLE_SCREEN_BUFFER_INFO csbiInfo;
-
-static WORD 
-#else
-static const char*
-#endif
+#ifdef WIN32
+static HANDLE hStdout;
+static WORD wOldColorAttrs;
+static CONSOLE_SCREEN_BUFFER_INFO csbiInfo;
+
+static WORD 
+#else
+static const char*
+#endif
 COLORS[] = { ESL_SEQ_DEFAULT_COLOR, ESL_SEQ_FRED, ESL_SEQ_FRED, 
 			ESL_SEQ_FRED, ESL_SEQ_FMAGEN, ESL_SEQ_FCYAN, ESL_SEQ_FGREEN, ESL_SEQ_FYELLOW };
 
@@ -88,11 +88,11 @@
 
 						if (tchannel == 0 || (file && !strcmp(file, "switch_console.c"))) {
 #ifdef WIN32
-							DWORD len = (DWORD) strlen(handle->last_event->body);
-							DWORD outbytes = 0;
-							SetConsoleTextAttribute(hStdout, COLORS[level]);
-							WriteFile(hStdout, handle->last_event->body, len, &outbytes, NULL);
-							SetConsoleTextAttribute(hStdout, wOldColorAttrs);
+							DWORD len = (DWORD) strlen(handle->last_event->body);
+							DWORD outbytes = 0;
+							SetConsoleTextAttribute(hStdout, COLORS[level]);
+							WriteFile(hStdout, handle->last_event->body, len, &outbytes, NULL);
+							SetConsoleTextAttribute(hStdout, wOldColorAttrs);
 #else
 							printf("%s%s%s", COLORS[level], handle->last_event->body, ESL_SEQ_DEFAULT_COLOR);
 #endif
@@ -228,13 +228,6 @@
 	char cfile[512] = ".\\fs_cli_config";
 	char *home = ""; //getenv("HOME");
 #endif
-	
-	strncpy(profiles[0].host, "127.0.0.1", sizeof(profiles[0].host));
-	strncpy(profiles[0].pass, "ClueCon", sizeof(profiles[0].pass));
-	strncpy(profiles[0].name, "default", sizeof(profiles[0].name));
-	profiles[0].port = 8021;
-	pcount++;
-
 	/* Vars for optargs */
 	int opt;
 	static struct option options[] = {
@@ -244,7 +237,12 @@
 		{"password", 1, 0, 'p'},
 		{0, 0, 0, 0}
 	};
-	
+
+	strncpy(profiles[0].host, "127.0.0.1", sizeof(profiles[0].host));
+	strncpy(profiles[0].pass, "ClueCon", sizeof(profiles[0].pass));
+	strncpy(profiles[0].name, "default", sizeof(profiles[0].name));
+	profiles[0].port = 8021;
+	pcount++;	
 	
 	if (home) {
 		snprintf(hfile, sizeof(hfile), "%s/.fs_cli_history", home);
@@ -287,7 +285,7 @@
 		esl_config_close_file(&cfg);
 	}
 
-	while (1){
+	for(;;) {
 		int option_index = 0;
 		opt = getopt_long(argc, argv, "H:U:P:S:p:h?", options, &option_index);
 		if (opt == -1) break;
@@ -357,10 +355,10 @@
 	history(myhistory, &ev, H_LOAD, hfile);
 #endif
 #ifdef WIN32
-	hStdout = GetStdHandle(STD_OUTPUT_HANDLE);
-	if (hStdout != INVALID_HANDLE_VALUE && GetConsoleScreenBufferInfo(hStdout, &csbiInfo)) {
-		wOldColorAttrs = csbiInfo.wAttributes;
-	}
+	hStdout = GetStdHandle(STD_OUTPUT_HANDLE);
+	if (hStdout != INVALID_HANDLE_VALUE && GetConsoleScreenBufferInfo(hStdout, &csbiInfo)) {
+		wOldColorAttrs = csbiInfo.wAttributes;
+	}
 #endif
 
 	snprintf(cmd_str, sizeof(cmd_str), "log info\n\n");

Modified: freeswitch/trunk/libs/esl/src/esl.c
==============================================================================
--- freeswitch/trunk/libs/esl/src/esl.c	(original)
+++ freeswitch/trunk/libs/esl/src/esl.c	Fri Dec 26 12:07:05 2008
@@ -861,7 +861,7 @@
 		esl_log(ESL_LOG_DEBUG, "SEND\n%s\n", cmd);
 	}
 	
-	if (send(handle->sock, cmd, strlen(cmd), 0) != strlen(cmd)) {
+	if (send(handle->sock, cmd, strlen(cmd), 0) != (int)strlen(cmd)) {
 		strerror_r(handle->errnum, handle->err, sizeof(handle->err));
 		return ESL_FAIL;
 	}



More information about the Freeswitch-svn mailing list