[RavenclawDev 335] [2007] Agents/TTYRecognitionServer2: 1) Ignore build dirs and user solution files.

tk@edam.speech.cs.cmu.edu tk at edam.speech.cs.cmu.edu
Fri Aug 17 20:32:37 EDT 2007


An HTML attachment was scrubbed...
URL: http://mailman.srv.cs.cmu.edu/pipermail/ravenclaw-developers/attachments/20070817/72b65d95/attachment-0001.html
-------------- next part --------------

Property changes on: Agents/TTYRecognitionServer2
___________________________________________________________________
Name: svn:ignore
   + Release
Debug
*.user


Modified: Agents/TTYRecognitionServer2/TTYRecognitionServer2.vcproj
===================================================================
--- Agents/TTYRecognitionServer2/TTYRecognitionServer2.vcproj	2007-08-18 00:24:13 UTC (rev 2006)
+++ Agents/TTYRecognitionServer2/TTYRecognitionServer2.vcproj	2007-08-18 00:32:37 UTC (rev 2007)
@@ -4,9 +4,7 @@
 	Version="8.00"
 	Name="TTYRecognitionServer2"
 	ProjectGUID="{7C9D9029-044B-4F98-8B97-A31480BBCE56}"
-	SccProjectName=""$/CommonAgents/TTYRecognitionServer2", NQCBAAAA"
-	SccLocalPath="."
-	SccProvider="MSSCCI:Microsoft Visual SourceSafe"
+	RootNamespace="TTYRecognitionServer2"
 	Keyword="MFCProj"
 	>
 	<Platforms>
@@ -107,7 +105,7 @@
 			<Tool
 				Name="VCPostBuildEventTool"
 				Description="Copy binaries to destination"
-				CommandLine="copy &quot;$(TARGETPATH)&quot; ..\..\bin\x86-nt\&quot;$(TARGETNAME)&quot;.exe"
+				CommandLine="copy &quot;$(TARGETPATH)&quot; &quot;..\..\bin\x86-nt\$(TARGETNAME).exe&quot;"
 			/>
 		</Configuration>
 		<Configuration

Modified: Agents/TTYRecognitionServer2/Utils.cpp
===================================================================
--- Agents/TTYRecognitionServer2/Utils.cpp	2007-08-18 00:24:13 UTC (rev 2006)
+++ Agents/TTYRecognitionServer2/Utils.cpp	2007-08-18 00:32:37 UTC (rev 2007)
@@ -71,7 +71,7 @@
 	va_start(pArgs, lpszFormat);
 
 	// print into the buffer
-	_vsnprintf(szBuffer, STRING_MAX, lpszFormat, pArgs);
+	_vsnprintf_s(szBuffer, STRING_MAX, lpszFormat, pArgs);
 	
 	// return a string object initialized from that buffer
 	return((string)szBuffer);
@@ -101,15 +101,15 @@
 
 // D: make a string uppercase
 string ToUpperCase(string sString) {
-	strcpy(szBuffer, sString.c_str());
-	_strupr(szBuffer);
+	strcpy_s(szBuffer, sString.c_str());
+	_strupr_s(szBuffer);
 	return (string)szBuffer;
 }
 
 // D: makes a string lowercase
 string ToLowerCase(string sString) {
-	strcpy(szBuffer, sString.c_str());
-	_strlwr(szBuffer);
+	strcpy_s(szBuffer, sString.c_str());
+	_strlwr_s(szBuffer);
 	return (string)szBuffer;
 }
 
@@ -356,10 +356,10 @@
     // until the current time changes so that we can avoid as much as 
     // possible granularity effects
     _timeb tTimeNow, tLastTime;
-    _ftime(&tTimeNow);
+    _ftime64_s(&tTimeNow);
     do {
         tLastTime = tTimeNow;
-        _ftime(&tTimeNow);
+        _ftime64_s(&tTimeNow);
     } while(tTimeNow.millitm == tLastTime.millitm);
     tStartUpTime = tTimeNow;
 
@@ -431,14 +431,14 @@
 
 // D: transforms a time (as a _timeb structure) into a string
 string TimeToString(_timeb time) {
-	tm* tmTime;
+	struct tm tmTime;
 	string sResult;
 	// convert to local timezone
-	tmTime = localtime(&time.time);
+        localtime_s(&tmTime, &time.time);
 
 	// and format it as a string and return it
-    return FormatString("%02d:%02d:%02d.%03d", tmTime->tm_hour, 
-		 tmTime->tm_min, tmTime->tm_sec, time.millitm);
+    return FormatString("%02d:%02d:%02d.%03d", tmTime.tm_hour, 
+		 tmTime.tm_min, tmTime.tm_sec, time.millitm);
 }
 
 // D: returns the time as a long int. Used mainly for logging purposes

Modified: Agents/TTYRecognitionServer2/main.cpp
===================================================================
--- Agents/TTYRecognitionServer2/main.cpp	2007-08-18 00:24:13 UTC (rev 2006)
+++ Agents/TTYRecognitionServer2/main.cpp	2007-08-18 00:32:37 UTC (rev 2007)
@@ -131,13 +131,13 @@
 		GAL_OA_INT, &iDontUseSessionManager)) 
 		iDontUseSessionManager=1;
 	if (!GalUtil_OAExtract(argc, argv, oas, "-hyp_slot", GAL_OA_STRING, &lpszTemp))
-		strcpy(lpszHypSlotName, DEFAULT_HYP_SLOT_NAME);
+		strcpy_s(lpszHypSlotName, DEFAULT_HYP_SLOT_NAME);
 	else
-		strcpy(lpszHypSlotName, lpszTemp);
+		strcpy_s(lpszHypSlotName, lpszTemp);
 	if (!GalUtil_OAExtract(argc, argv, oas, "-conf_slot", GAL_OA_STRING, &lpszTemp))
-		strcpy(lpszConfSlotName, DEFAULT_CONF_SLOT_NAME);
+		strcpy_s(lpszConfSlotName, DEFAULT_CONF_SLOT_NAME);
 	else
-		strcpy(lpszConfSlotName, lpszTemp);
+		strcpy_s(lpszConfSlotName, lpszTemp);
 	free(lpszTemp);
 
 	InitializeHighResolutionTimer();
@@ -154,7 +154,7 @@
 	float fTTYConfidence = -1;
 	char *lpszTTYConfidence;
 	if((lpszTTYConfidence = strchr(buf, '|')) != NULL) {
-		sscanf(lpszTTYConfidence, "|%f", &fTTYConfidence);
+		sscanf_s(lpszTTYConfidence, "|%f", &fTTYConfidence);
 		// chop the previous string there
 		lpszTTYConfidence[0] = 0;
 	}
@@ -299,14 +299,14 @@
 	if ( Gal_GetObject(f, ":id") )
 		szID = Gal_GetString(f, ":id");
 	else
-		szID = strdup("DUMMY_ID");
+		szID = _strdup("DUMMY_ID");
 	conceptposlist[0] = word[0] = '\0';
 	while ( len = get_word(&temputt, word) )
 	{
 		if ( word[0] == '<' ) // beginning of concept realization
 		{
-			strcat(conceptposlist, word+1);
-			strcat(conceptposlist, " ");
+			strcat_s(conceptposlist, word+1);
+			strcat_s(conceptposlist, " ");
 			i--; // not a real word; counteract default increment
 		}
 		else if ( (sublen = firstOf(word, ">")) < len ) //end of concept realization
@@ -314,27 +314,27 @@
 			char intbuf[7];
 			word[sublen] = '\0';
 
-			sprintf(intbuf, "%d ", i);
-			strcat(conceptposlist, intbuf);
+			sprintf_s(intbuf, "%d ", i);
+			strcat_s(conceptposlist, intbuf);
 
-			strcat(prunedutt,word);
+			strcat_s(prunedutt, MAX_BUF_LENGTH, word);
 			if ( firstOf(word+sublen+1, ",;:'\"?.!") < len - sublen -1 )
 			{
 				// just add the punctuation after the >
-				strcat(prunedutt, word+sublen+1);
-				strcat(prunedutt, " ");
+				strcat_s(prunedutt, MAX_BUF_LENGTH, word+sublen+1);
+				strcat_s(prunedutt, MAX_BUF_LENGTH, " ");
 			}
 			else 
 			{
-				strcat(prunedutt, " ");
+				strcat_s(prunedutt, MAX_BUF_LENGTH, " ");
 				temputt -= ( len-sublen-1);
 			}
 
 		}
 		else
 		{
-			strcat(prunedutt, word);
-			strcat(prunedutt, " ");
+			strcat_s(prunedutt, MAX_BUF_LENGTH, word);
+			strcat_s(prunedutt, MAX_BUF_LENGTH, " ");
 		}
 		i++;
 		word[0] = '\0';
@@ -392,7 +392,7 @@
 
 	taggedutt[0] = totts[0] = '\0';
 	if (Gal_GetObject(f, ":tty-phrase"))
-		strcat(taggedutt, Gal_GetString(f, ":tty-phrase"));
+		strcat_s(taggedutt, Gal_GetString(f, ":tty-phrase"));
 	else {
 		printf("TTY-Warning: Can't find :tty-phrase in incoming \"speak\" frame.\n");
 		Gal_SetProp(f, ":error", Gal_IntObject(1));
@@ -410,7 +410,8 @@
 	i = strlen(totts);
 	
 	// write this to the file
-	FILE* flid = fopen(sLogFileName.c_str(), "a");
+        FILE* flid;
+        fopen_s(&flid, sLogFileName.c_str(), "a");
 	if(flid) {
 		fprintf(flid, "S: %s\n", totts);
 		fclose(flid);
@@ -462,7 +463,8 @@
     }
 
 	// write this to the file
-	FILE* flid = fopen(sLogFileName.c_str(), "a");
+	FILE* flid;
+        fopen_s(&flid, sLogFileName.c_str(), "a");
 	if(flid) {
 		fprintf(flid, "U: %s\n", utterance);
 		fclose(flid);

Modified: Agents/TTYRecognitionServer2/tty.cpp
===================================================================
--- Agents/TTYRecognitionServer2/tty.cpp	2007-08-18 00:24:13 UTC (rev 2006)
+++ Agents/TTYRecognitionServer2/tty.cpp	2007-08-18 00:32:37 UTC (rev 2007)
@@ -7,7 +7,7 @@
 UINT GetTTYInputThread(void) {
 	char buf[1024];
 	while(1) {
-		gets(buf);
+		gets_s(buf);
 		if(!strcmp(buf, "init_session")) 
 			init_sessions();
 		else if(!strcmp(buf, "close_session"))


More information about the Ravenclaw-developers mailing list