Loading...
--- Libc/Libc-1725.40.4/gen/getttyent.c
+++ Libc/Libc-583/gen/getttyent.c
@@ -63,9 +63,6 @@
#include <regex.h>
#include <limits.h>
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wstrict-prototypes"
-
static char zapchar;
static FILE *tf;
@@ -101,20 +98,20 @@
char fmt[NAME_MAX + 17];
};
-static const char *brapat = "\\[(.*)]";
+static char brapat[] = "\\[(.*)]";
static regex_t brapreg;
-static const char *decpat = "^([0-9]+)-([0-9]+)$";
+static char decpat[] = "^([0-9]+)-([0-9]+)$";
static regex_t decpreg;
-static const char *hexpat = "^0x([0-9a-f]+)-0x([0-9a-f]+)$";
+static char hexpat[] = "^0x([0-9a-f]+)-0x([0-9a-f]+)$";
static regex_t hexpreg;
static struct seq *seq = NULL;
static int slot;
struct ttyent *
-getttyent(void)
+getttyent()
{
static struct ttyent tty;
- static const struct ttyent nonexistent = {
+ static struct ttyent nonexistent = {
"\01", /* this shouldn't match anything */
NULL,
NULL,
@@ -148,7 +145,7 @@
* entries until we catch up.
*/
slot++;
- return (struct ttyent *)&nonexistent;
+ return &nonexistent;
}
if (seq->count > 0) {
@@ -265,8 +262,8 @@
goto restart;
/* seq->first is already less than slot, so just leave it */
- seq->count = (int)(e - b + 1);
- seq->index = (int)(b);
+ seq->count = e - b + 1;
+ seq->index = b;
/*
* The fmt string contains the characters before the bracket, the
* a format specifier (either decimal or hex) and any characters
@@ -388,5 +385,3 @@
}
return (1);
}
-#pragma clang diagnostic pop
-