summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorberkeviktor@aol.com <berkeviktor@aol.com>2011-05-30 21:15:39 +0200
committerberkeviktor@aol.com <berkeviktor@aol.com>2011-05-30 21:15:39 +0200
commitb85f311ddd7a1275e49289ba935617a163062790 (patch)
tree01ef2482433adcd7ab748eb4cc7561214c294b26
parentbfb61201168844e8432b328332b431d8dbca2a2a (diff)
move cpu arch stuff to separate function
-rw-r--r--src/common/util.c18
-rw-r--r--src/common/util.h1
-rw-r--r--src/fe-gtk/about.c15
3 files changed, 20 insertions, 14 deletions
diff --git a/src/common/util.c b/src/common/util.c
index 67168a5f..5677e82a 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -647,6 +647,24 @@ get_mhz (void)
 	return 0;	/* fails on Win9x */
 }
 
+int
+get_cpu_arch (void)
+{
+	SYSTEM_INFO si;
+	unsigned short int cpu_arch;
+
+	GetSystemInfo (&si);
+
+	if (si.wProcessorArchitecture == 9)
+	{
+		return 64;
+	}
+	else
+	{
+		return 86;
+	}
+}
+
 char *
 get_cpu_str (void)
 {
diff --git a/src/common/util.h b/src/common/util.h
index cd9e1fff..92d2a843 100644
--- a/src/common/util.h
+++ b/src/common/util.h
@@ -45,6 +45,7 @@ char *errorstring (int err);
 int waitline (int sok, char *buf, int bufsize, int);
 #ifdef WIN32
 int waitline2 (GIOChannel *source, char *buf, int bufsize);
+int get_cpu_arch (void);
 #else
 #define waitline2(source,buf,size) waitline(serv->childread,buf,size,0)
 #endif
diff --git a/src/fe-gtk/about.c b/src/fe-gtk/about.c
index 453d405c..6e69b646 100644
--- a/src/fe-gtk/about.c
+++ b/src/fe-gtk/about.c
@@ -88,19 +88,6 @@ menu_about (GtkWidget * wid, gpointer sess)
 	char buf[512];
 	const char *locale = NULL;
 	extern GtkWindow *parent_window;      /* maingui.c */
-	SYSTEM_INFO si;
-	unsigned short int cpu_arch;
-
-	GetSystemInfo (&si);
-
-	if (si.wProcessorArchitecture == 9)
-	{
-		cpu_arch = 64;
-	}
-	else
-	{
-		cpu_arch = 86;
-	}
 
 	if (about)
 	{
@@ -146,7 +133,7 @@ menu_about (GtkWidget * wid, gpointer sess)
 				gtk_minor_version,
 				gtk_micro_version,
 				(portable_mode () ? "Yes" : "No"),
-				cpu_arch
+				get_cpu_arch ()
 #else
 				"%s\n\n"
 				"%s\n"