Fixed warnings in Cygwin

This commit is contained in:
Alfons Laarman 2012-08-12 17:23:37 +02:00
parent 7ba2035379
commit 92bed4de11
4 changed files with 51 additions and 7 deletions

View file

@ -432,7 +432,7 @@ void mk_alternating(Node *p) /* generates an alternating automaton for p */
if(tl_stats) { if(tl_stats) {
getrusage(RUSAGE_SELF, &tr_fin); getrusage(RUSAGE_SELF, &tr_fin);
timeval_subtract (&t_diff, &tr_fin.ru_utime, &tr_debut.ru_utime); timeval_subtract (&t_diff, &tr_fin.ru_utime, &tr_debut.ru_utime);
fprintf(tl_out, "\nBuilding and simplification of the alternating automaton: %lli.%06is", fprintf(tl_out, "\nBuilding and simplification of the alternating automaton: %lli.%06ld",
(long long int)t_diff.tv_sec, t_diff.tv_usec); (long long int)t_diff.tv_sec, t_diff.tv_usec);
fprintf(tl_out, "\n%i states, %i transitions\n", astate_count, atrans_count); fprintf(tl_out, "\n%i states, %i transitions\n", astate_count, atrans_count);
} }

View file

@ -112,7 +112,7 @@ int simplify_btrans() /* simplifies the transitions */
if(tl_stats) { if(tl_stats) {
getrusage(RUSAGE_SELF, &tr_fin); getrusage(RUSAGE_SELF, &tr_fin);
timeval_subtract (&t_diff, &tr_fin.ru_utime, &tr_debut.ru_utime); timeval_subtract (&t_diff, &tr_fin.ru_utime, &tr_debut.ru_utime);
fprintf(tl_out, "\nSimplification of the Buchi automaton - transitions: %lli.%06is", fprintf(tl_out, "\nSimplification of the Buchi automaton - transitions: %lli.%06ld",
(long long int)t_diff.tv_sec, t_diff.tv_usec); (long long int)t_diff.tv_sec, t_diff.tv_usec);
fprintf(tl_out, "\n%i transitions removed\n", changed); fprintf(tl_out, "\n%i transitions removed\n", changed);
@ -226,7 +226,7 @@ int simplify_bstates() /* eliminates redundant states */
if(tl_stats) { if(tl_stats) {
getrusage(RUSAGE_SELF, &tr_fin); getrusage(RUSAGE_SELF, &tr_fin);
timeval_subtract (&t_diff, &tr_fin.ru_utime, &tr_debut.ru_utime); timeval_subtract (&t_diff, &tr_fin.ru_utime, &tr_debut.ru_utime);
fprintf(tl_out, "\nSimplification of the Buchi automaton - states: %lli.%06is", fprintf(tl_out, "\nSimplification of the Buchi automaton - states: %lli.%06ld",
(long long int)t_diff.tv_sec, t_diff.tv_usec); (long long int)t_diff.tv_sec, t_diff.tv_usec);
fprintf(tl_out, "\n%i states removed\n", changed); fprintf(tl_out, "\n%i states removed\n", changed);
} }
@ -671,7 +671,7 @@ void mk_buchi()
if(tl_stats) { if(tl_stats) {
getrusage(RUSAGE_SELF, &tr_fin); getrusage(RUSAGE_SELF, &tr_fin);
timeval_subtract (&t_diff, &tr_fin.ru_utime, &tr_debut.ru_utime); timeval_subtract (&t_diff, &tr_fin.ru_utime, &tr_debut.ru_utime);
fprintf(tl_out, "\nBuilding the Buchi automaton : %lli.%06is", fprintf(tl_out, "\nBuilding the Buchi automaton : %lli.%06ld",
(long long int)t_diff.tv_sec, t_diff.tv_usec); (long long int)t_diff.tv_sec, t_diff.tv_usec);
fprintf(tl_out, "\n%i states, %i transitions\n", bstate_count, btrans_count); fprintf(tl_out, "\n%i states, %i transitions\n", bstate_count, btrans_count);
} }

View file

@ -151,7 +151,7 @@ int simplify_gtrans() /* simplifies the transitions */
if(tl_stats) { if(tl_stats) {
getrusage(RUSAGE_SELF, &tr_fin); getrusage(RUSAGE_SELF, &tr_fin);
timeval_subtract (&t_diff, &tr_fin.ru_utime, &tr_debut.ru_utime); timeval_subtract (&t_diff, &tr_fin.ru_utime, &tr_debut.ru_utime);
fprintf(tl_out, "\nSimplification of the generalized Buchi automaton - transitions: %lli.%06is", fprintf(tl_out, "\nSimplification of the generalized Buchi automaton - transitions: %lli.%06ld",
(long long int)t_diff.tv_sec, t_diff.tv_usec); (long long int)t_diff.tv_sec, t_diff.tv_usec);
fprintf(tl_out, "\n%i transitions removed\n", changed); fprintf(tl_out, "\n%i transitions removed\n", changed);
} }
@ -244,7 +244,7 @@ int simplify_gstates() /* eliminates redundant states */
if(tl_stats) { if(tl_stats) {
getrusage(RUSAGE_SELF, &tr_fin); getrusage(RUSAGE_SELF, &tr_fin);
timeval_subtract (&t_diff, &tr_fin.ru_utime, &tr_debut.ru_utime); timeval_subtract (&t_diff, &tr_fin.ru_utime, &tr_debut.ru_utime);
fprintf(tl_out, "\nSimplification of the generalized Buchi automaton - states: %lli.%06is", fprintf(tl_out, "\nSimplification of the generalized Buchi automaton - states: %lli.%06ld",
(long long int)t_diff.tv_sec, t_diff.tv_usec); (long long int)t_diff.tv_sec, t_diff.tv_usec);
fprintf(tl_out, "\n%i states removed\n", changed); fprintf(tl_out, "\n%i states removed\n", changed);
} }
@ -616,7 +616,7 @@ void mk_generalized()
if(tl_stats) { if(tl_stats) {
getrusage(RUSAGE_SELF, &tr_fin); getrusage(RUSAGE_SELF, &tr_fin);
timeval_subtract (&t_diff, &tr_fin.ru_utime, &tr_debut.ru_utime); timeval_subtract (&t_diff, &tr_fin.ru_utime, &tr_debut.ru_utime);
fprintf(tl_out, "\nBuilding the generalized Buchi automaton : %lli.%06is", fprintf(tl_out, "\nBuilding the generalized Buchi automaton : %lli.%06ld",
(long long int)t_diff.tv_sec, t_diff.tv_usec); (long long int)t_diff.tv_sec, t_diff.tv_usec);
fprintf(tl_out, "\n%i states, %i transitions\n", gstate_count, gtrans_count); fprintf(tl_out, "\n%i states, %i transitions\n", gstate_count, gtrans_count);
} }

44
util.c
View file

@ -13,6 +13,50 @@ int tl_verbose = 0;
int tl_terse = 0; int tl_terse = 0;
unsigned long All_Mem = 0; unsigned long All_Mem = 0;
#ifdef __GLIBC__
size_t strlcpy(char *dst, const char *src, size_t size)
{
size_t bytes = 0;
char *q = dst;
const char *p = src;
char ch;
while ((ch = *p++)) {
if (bytes+1 < size)
*q++ = ch;
bytes++;
}
/* If size == 0 there is no space for a final null... */
if (size)
*q = '\0';
return bytes;
}
size_t strlcat(char *dst, const char *src, size_t size)
{
size_t bytes = 0;
char *q = dst;
const char *p = src;
char ch;
while (bytes < size && *q) {
q++;
bytes++;
}
if (bytes == size)
return (bytes + strlen(src));
while ((ch = *p++)) {
if (bytes+1 < size)
*q++ = ch;
bytes++;
}
*q = '\0';
return bytes;
}
#endif /* __GLIBC__ */
static char uform[4096]; static char uform[4096];
static int hasuform=0, cnt=0; static int hasuform=0, cnt=0;