diff --git a/src/fpga.c b/src/fpga.c index 46895c0f6..da8205076 100644 --- a/src/fpga.c +++ b/src/fpga.c @@ -31,9 +31,9 @@ int fpga_tests(int argc, char *argv[], struct fpga *f); struct settings settings; -void usage(char *name) +void usage() { - printf("Usage: %s CONFIGFILE CMD [OPTIONS]\n", name); + printf("Usage: villas-fpga CONFIGFILE CMD [OPTIONS]\n"); printf(" Commands:\n"); printf(" tests Test functionality of VILLASfpga card\n"); printf(" benchmarks Do benchmarks\n\n"); @@ -57,13 +57,13 @@ int main(int argc, char *argv[]) } subcommand; if (argc < 3) - usage(argv[0]); + usage(); if (strcmp(argv[2], "tests") == 0) subcommand = FPGA_TESTS; else if (strcmp(argv[2], "benchmarks") == 0) subcommand = FPGA_BENCH; else - usage(argv[0]); + usage(); /* Parse arguments */ char c, *endptr; @@ -75,7 +75,7 @@ int main(int argc, char *argv[]) case '?': default: - usage(argv[0]); + usage(); } } diff --git a/src/node.c b/src/node.c index 1a4305b90..4f89f6bbf 100644 --- a/src/node.c +++ b/src/node.c @@ -71,9 +71,9 @@ static void signals_init() sigaction(SIGTERM, &sa_quit, NULL); } -static void usage(const char *name) +static void usage() { - printf("Usage: %s CONFIG\n", name); + printf("Usage: villas-node CONFIG\n"); printf(" CONFIG is a required path to a configuration file\n\n"); #ifdef ENABLE_OPAL_ASYNC printf("Usage: %s OPAL_ASYNC_SHMEM_NAME OPAL_ASYNC_SHMEM_SIZE OPAL_PRINT_SHMEM_NAME\n", name); @@ -103,7 +103,7 @@ int main(int argc, char *argv[]) #else if (argc != 2) #endif - usage(argv[0]); + usage(); char *configfile = (argc == 2) ? argv[1] : "opal-shmem.conf"; diff --git a/src/pipe.c b/src/pipe.c index 334fa0302..626536b08 100644 --- a/src/pipe.c +++ b/src/pipe.c @@ -69,9 +69,9 @@ static void quit(int signal, siginfo_t *sinfo, void *ctx) exit(EXIT_SUCCESS); } -static void usage(char *name) +static void usage() { - printf("Usage: %s CONFIG NODE [OPTIONS]\n", name); + printf("Usage: villas-pipe CONFIG NODE [OPTIONS]\n"); printf(" CONFIG path to a configuration file\n"); printf(" NODE the name of the node to which samples are sent and received from\n"); printf(" OPTIONS are:\n"); @@ -100,7 +100,7 @@ static void * send_loop(void *ctx) if (ret < 0) error("Failed to allocate memory for receive pool."); - ret = sample_get_many(&sendd.pool, smps, node->vectorize); + ret = sample_alloc(&sendd.pool, smps, node->vectorize); if (ret < 0) error("Failed to get %u samples out of send pool (%d).", node->vectorize, ret); @@ -144,7 +144,7 @@ static void * recv_loop(void *ctx) if (ret < 0) error("Failed to allocate memory for receive pool."); - ret = sample_get_many(&recvv.pool, smps, node->vectorize); + ret = sample_alloc(&recvv.pool, smps, node->vectorize); if (ret < 0) error("Failed to get %u samples out of receive pool (%d).", node->vectorize, ret); @@ -180,7 +180,7 @@ int main(int argc, char *argv[]) /* Parse command line arguments */ if (argc < 3) - usage(argv[0]); + usage(); /* Default values */ sendd.enabled = true; @@ -202,7 +202,7 @@ int main(int argc, char *argv[]) break; case 'h': case '?': - usage(argv[0]); + usage(); } } diff --git a/src/signal.c b/src/signal.c index 82e6b9e27..bce67fadd 100644 --- a/src/signal.c +++ b/src/signal.c @@ -30,9 +30,9 @@ enum SIGNAL_TYPE { TYPE_MIXED }; -void usage(char *name) +void usage() { - printf("Usage: %s SIGNAL [OPTIONS]\n", name); + printf("Usage: villas-signal SIGNAL [OPTIONS]\n"); printf(" SIGNAL is on of: 'mixed', 'random', 'sine', 'triangle', 'square', 'ramp'\n"); printf(" -v NUM specifies how many values a message should contain\n"); printf(" -r HZ how many messages per second\n"); @@ -59,7 +59,7 @@ int main(int argc, char *argv[]) log_init(); if (argc < 2) { - usage(argv[0]); + usage(); exit(EXIT_FAILURE); } @@ -101,7 +101,7 @@ int main(int argc, char *argv[]) goto check; case 'h': case '?': - usage(argv[0]); + usage(); } continue; diff --git a/src/test.c b/src/test.c index ef95b2c65..4f9e351b9 100644 --- a/src/test.c +++ b/src/test.c @@ -53,9 +53,9 @@ void quit() running = 0; } -void usage(char *name) +void usage() { - printf("Usage: %s CONFIG TEST NODE [ARGS]\n", name); + printf("Usage: villas-test CONFIG TEST NODE [ARGS]\n"); printf(" CONFIG path to a configuration file\n"); printf(" TEST the name of the test to execute: 'rtt'\n"); printf(" NODE name of the node which shoud be used\n\n"); @@ -68,7 +68,7 @@ int main(int argc, char *argv[]) config_t config; if (argc < 4) { - usage(argv[0]); + usage(); exit(EXIT_FAILURE); } @@ -184,7 +184,7 @@ void test_rtt() { struct stat st; if (!fstat(fd, &st)) { FILE *f = fdopen(fd, "w"); - hist_matlab(&hist, f); + hist_dump_matlab(&hist, f); } else error("Invalid file descriptor: %u", fd);