summaryrefslogtreecommitdiff
path: root/gnu/lib/libf2c/libF77/s_cmp.c
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/lib/libf2c/libF77/s_cmp.c')
-rw-r--r--gnu/lib/libf2c/libF77/s_cmp.c75
1 files changed, 40 insertions, 35 deletions
diff --git a/gnu/lib/libf2c/libF77/s_cmp.c b/gnu/lib/libf2c/libF77/s_cmp.c
index 1e052f28642..5b43c9edb9c 100644
--- a/gnu/lib/libf2c/libF77/s_cmp.c
+++ b/gnu/lib/libf2c/libF77/s_cmp.c
@@ -2,43 +2,48 @@
/* compare two strings */
-#ifdef KR_headers
-integer s_cmp(a0, b0, la, lb) char *a0, *b0; ftnlen la, lb;
-#else
-integer s_cmp(char *a0, char *b0, ftnlen la, ftnlen lb)
-#endif
+integer
+s_cmp (char *a0, char *b0, ftnlen la, ftnlen lb)
{
-register unsigned char *a, *aend, *b, *bend;
-a = (unsigned char *)a0;
-b = (unsigned char *)b0;
-aend = a + la;
-bend = b + lb;
+ register unsigned char *a, *aend, *b, *bend;
+ a = (unsigned char *) a0;
+ b = (unsigned char *) b0;
+ aend = a + la;
+ bend = b + lb;
-if(la <= lb)
- {
- while(a < aend)
- if(*a != *b)
- return( *a - *b );
- else
- { ++a; ++b; }
+ if (la <= lb)
+ {
+ while (a < aend)
+ if (*a != *b)
+ return (*a - *b);
+ else
+ {
+ ++a;
+ ++b;
+ }
- while(b < bend)
- if(*b != ' ')
- return( ' ' - *b );
- else ++b;
- }
+ while (b < bend)
+ if (*b != ' ')
+ return (' ' - *b);
+ else
+ ++b;
+ }
-else
- {
- while(b < bend)
- if(*a == *b)
- { ++a; ++b; }
- else
- return( *a - *b );
- while(a < aend)
- if(*a != ' ')
- return(*a - ' ');
- else ++a;
- }
-return(0);
+ else
+ {
+ while (b < bend)
+ if (*a == *b)
+ {
+ ++a;
+ ++b;
+ }
+ else
+ return (*a - *b);
+ while (a < aend)
+ if (*a != ' ')
+ return (*a - ' ');
+ else
+ ++a;
+ }
+ return (0);
}