Fix prototypes and unused variables

This commit is contained in:
Rodrigo Arias 2021-10-18 12:44:43 +02:00
parent 55ae07403c
commit c2f7085e11
3 changed files with 37 additions and 37 deletions

40
dump.c
View File

@ -12,25 +12,25 @@
#include "ovni_trace.h"
#include "emu.h"
//static void
//hexdump(uint8_t *buf, size_t size)
//{
// size_t i, j;
//
// //printf("writing %ld bytes in cpu=%d\n", size, rthread.cpu);
//
// for(i=0; i<size; i+=16)
// {
// for(j=0; j<16 && i+j < size; j++)
// {
// fprintf(stderr, "%02x ", buf[i+j]);
// }
// fprintf(stderr, "\n");
// }
//}
static void
hexdump(uint8_t *buf, size_t size)
{
int i, j;
//printf("writing %ld bytes in cpu=%d\n", size, rthread.cpu);
for(i=0; i<size; i+=16)
{
for(j=0; j<16 && i+j < size; j++)
{
fprintf(stderr, "%02x ", buf[i+j]);
}
fprintf(stderr, "\n");
}
}
void emit(struct ovni_stream *stream, struct ovni_ev *ev)
emit(struct ovni_stream *stream, struct ovni_ev *ev)
{
int64_t delta;
uint64_t clock;
@ -58,9 +58,11 @@ void emit(struct ovni_stream *stream, struct ovni_ev *ev)
}
void dump_events(struct ovni_trace *trace)
static void
dump_events(struct ovni_trace *trace)
{
int i, f;
size_t i;
ssize_t f;
uint64_t minclock, lastclock;
struct ovni_ev *ev;
struct ovni_stream *stream;

View File

@ -84,8 +84,8 @@ cmp_double(const void *pa, const void *pb)
return 0;
}
void
usage(int argc, char *argv[])
static void
usage(void)
{
fprintf(stderr, "%s: clock synchronization utility\n", progname);
fprintf(stderr, "\n");
@ -94,7 +94,7 @@ usage(int argc, char *argv[])
exit(EXIT_FAILURE);
}
void
static void
parse_options(struct options *options, int argc, char *argv[])
{
int opt;
@ -120,7 +120,7 @@ parse_options(struct options *options, int argc, char *argv[])
options->nsamples = atoi(optarg);
break;
default: /* '?' */
usage(argc, argv);
usage();
}
}
@ -131,7 +131,7 @@ parse_options(struct options *options, int argc, char *argv[])
}
}
void
static void
get_clock_samples(struct offset *offset, int nsamples)
{
int i;
@ -150,7 +150,7 @@ get_clock_samples(struct offset *offset, int nsamples)
offset->wall_t1 = get_time(CLOCK_REALTIME, 0);
}
void
static void
fill_offset(struct offset *offset, int nsamples)
{
int warmup_nsamples;
@ -174,7 +174,7 @@ fill_offset(struct offset *offset, int nsamples)
get_clock_samples(offset, nsamples);
}
void
static void
offset_compute_delta(struct offset *ref, struct offset *cur, int nsamples, int verbose)
{
int i;
@ -222,13 +222,13 @@ offset_compute_delta(struct offset *ref, struct offset *cur, int nsamples, int v
free(delta);
}
size_t
static size_t
offset_size(int nsamples)
{
return sizeof(struct offset) + sizeof(double) * nsamples;
}
struct offset *
static struct offset *
table_get_offset(struct offset_table *table, int i, int nsamples)
{
char *p;
@ -239,7 +239,7 @@ table_get_offset(struct offset_table *table, int i, int nsamples)
return (struct offset *) p;
}
struct offset_table *
static struct offset_table *
build_offset_table(int nsamples, int rank, int verbose)
{
int i;
@ -323,7 +323,7 @@ build_offset_table(int nsamples, int rank, int verbose)
return table;
}
void
static void
print_drift_header(struct offset_table *table)
{
int i;
@ -340,11 +340,10 @@ print_drift_header(struct offset_table *table)
printf("\n");
}
void
static void
print_drift_row(struct offset_table *table)
{
int i;
char buf[64];
printf("%-20f", table->offset[0]->wall_t1);
@ -354,7 +353,7 @@ print_drift_row(struct offset_table *table)
printf("\n");
}
void
static void
print_table_detailed(struct offset_table *table)
{
int i;
@ -370,7 +369,7 @@ print_table_detailed(struct offset_table *table)
}
}
void
static void
do_work(struct options *options, int rank)
{
int drift_mode;

View File

@ -17,10 +17,9 @@
#endif
static inline void
init()
init(void)
{
char hostname[HOST_NAME_MAX];
char *appid;
if(gethostname(hostname, HOST_NAME_MAX) != 0)
{
@ -38,7 +37,7 @@ int main(int argc, char *argv[])
struct ovni_ev ev = {0};
int i, n;
if(argv[1] != NULL)
if(argc > 1)
n = atoi(argv[1]);
else
n = 1000;