- some tweaks to version.cc

Tue, 08 Apr 2014 11:07:25 +0300

author
Santeri Piippo <crimsondusk64@gmail.com>
date
Tue, 08 Apr 2014 11:07:25 +0300
changeset 658
2ca8316e0109
parent 657
5cfbf4dffebf
child 659
06c4477675e4
child 711
7f7cbe63b16f

- some tweaks to version.cc

src/version.cc file | annotate | diff | comparison | revisions
--- a/src/version.cc	Tue Apr 08 11:03:44 2014 +0300
+++ b/src/version.cc	Tue Apr 08 11:07:25 2014 +0300
@@ -16,42 +16,46 @@
  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+// Note: only using stock C stuff in this file, keeping the STL/Qt stuff out
+// makes this simple file very fast to compile, which is nice since this file
+// must be compiled every time I commit something.
+
 #include <stdio.h>
 #include <string.h>
 #include "version.h"
 #include "gitinfo.h"
 
-char gVersionString[64] = {'\0'};
-char gFullVersionString[256] = {'\0'};
+char g_versionString[64] = {'\0'};
+char g_fullVersionString[256] = {'\0'};
 
 // =============================================================================
 //
 const char* versionString()
 {
-	if (gVersionString[0] == '\0')
+	if (g_versionString[0] == '\0')
 	{
 #if VERSION_PATCH == 0
-		sprintf (gVersionString, "%d.%d", VERSION_MAJOR, VERSION_MINOR);
+		sprintf (g_versionString, "%d.%d", VERSION_MAJOR, VERSION_MINOR);
 #else
-		sprintf (gVersionString, "%d.%d.%d", VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH);
+		sprintf (g_versionString, "%d.%d.%d", VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH);
 #endif // VERSION_PATCH
 	}
 
-	return gVersionString;
+	return g_versionString;
 }
 
 // =============================================================================
 //
 const char* fullVersionString()
 {
-	if (gFullVersionString[0] == '\0')
+	if (g_fullVersionString[0] == '\0')
 	{
 #if BUILD_ID != BUILD_RELEASE
-		strcpy (gFullVersionString, GIT_DESCRIPTION);
+		strcpy (g_fullVersionString, GIT_DESCRIPTION);
 #else
-		sprintf (gFullVersionString, "v%s", versionString());
+		sprintf (g_fullVersionString, "v%s", versionString());
 #endif
 	}
 
-	return gFullVersionString;
+	return g_fullVersionString;
 }

mercurial