Skip to content
Browse files

[GH #846] Harmonize generic/cpu_type.c: "unknown"

Harmonize with win32 version:
Return "unknown" not ""
Add PARROT_CANNOT_RETURN_NULL
Fix description
  • Loading branch information...
1 parent 988986b commit 88ed1c628eed90874023cf51e49b1a9e5e59bd4b @rurban rurban committed
Showing with 8 additions and 5 deletions.
  1. +2 −0 ChangeLog
  2. +6 −5 src/platform/generic/cpu_type.c
View
2 ChangeLog
@@ -8,6 +8,8 @@
+ Preload Configure steps when called with perl -d Configure.pl [GH #833]
+ Strip unneeded config keys from installed config hash. Saves 6360
bytes from every installed executable. [GH #824]
+ + Parrot_get_cpu_type returns now "unknown" for all unknown cpu types.
+ On non-windows it returned before 4.9.0 a null string. [GH #846]
- Build
+ Improved warnings for clang. [GH #843]
+ Cleaned wrong UNUSED(arg) macros in all pmc's due to an improved
View
11 src/platform/generic/cpu_type.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011, Parrot Foundation.
+ * Copyright (C) 2011-2012, Parrot Foundation.
*/
/*
@@ -33,8 +33,8 @@ For win32, look in platform/win32/cpu_type.c
=item C<STRING * Parrot_get_cpu_type(Parrot_Interp interp)>
-Fetch CPU type for non-win32 systems
-For win32, look in platform/win32/misc.c
+Fetch CPU type for non-win32 systems.
+For win32, look in platform/win32/cpu_type.c
=back
@@ -42,6 +42,7 @@ For win32, look in platform/win32/misc.c
*/
+PARROT_CANNOT_RETURN_NULL
STRING *
Parrot_get_cpu_type(Parrot_Interp interp) {
struct utsname uname_info;
@@ -51,10 +52,10 @@ Parrot_get_cpu_type(Parrot_Interp interp) {
uname(&uname_info);
proc_arch = uname_info.machine;
#else
- *proc_arch = '\0';
+ proc_arch ="unknown";
#endif
return Parrot_str_new_init(interp, proc_arch, strlen(proc_arch),
- Parrot_ascii_encoding_ptr, 0);
+ Parrot_ascii_encoding_ptr, 0);
}

0 comments on commit 88ed1c6

Please sign in to comment.
Something went wrong with that request. Please try again.