summaryrefslogtreecommitdiffstats
path: root/Modules/TestBigEndian.c
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2004-04-15 12:22:19 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2004-04-15 12:22:19 (GMT)
commitfad91fb77038a243711677e904314ff0f283a68c (patch)
tree89337a6d28353128b27da9115ac1452d50907b91 /Modules/TestBigEndian.c
parentc7a42a1b1f633d89d1d80d8b2703202b0827724e (diff)
downloadCMake-fad91fb77038a243711677e904314ff0f283a68c.zip
CMake-fad91fb77038a243711677e904314ff0f283a68c.tar.gz
CMake-fad91fb77038a243711677e904314ff0f283a68c.tar.bz2
ENH: fix tests for non-ansi c on hp and remove warnings for ansi c
Diffstat (limited to 'Modules/TestBigEndian.c')
-rw-r--r--Modules/TestBigEndian.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/Modules/TestBigEndian.c b/Modules/TestBigEndian.c
index 97647ed..db08ceb 100644
--- a/Modules/TestBigEndian.c
+++ b/Modules/TestBigEndian.c
@@ -1,5 +1,10 @@
-int main (int ac, char*av[]) {
- int ret = 1;
+#ifdef __CLASSIC_C__
+int main(){
+ int ac;
+ char*av[];
+#else
+int main(int ac, char*av[]){
+#endif
/* Are we little or big endian? From Harbison&Steele. */
union
{
@@ -7,9 +12,6 @@ int main (int ac, char*av[]) {
char c[sizeof (long)];
} u;
u.l = 1;
- if(ac > 100)
- {
- ret = *av[0];
- }
- return (u.c[sizeof (long) - 1] == 1)?ret:0;
+ if(ac > 1000){return *av[0];}
+ return (u.c[sizeof (long) - 1] == 1)?1:0;
}