1
1

chore: Change applicable function arguments from 'char *' to 'const char *' (#1006)

Fixes #946.  Should not present any functional changes.
Этот коммит содержится в:
David Bar-On 2020-06-12 20:03:30 +03:00 коммит произвёл GitHub
родитель 0b0aa349fa
Коммит 3888e044c3
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
7 изменённых файлов: 30 добавлений и 30 удалений

Просмотреть файл

@ -119,7 +119,7 @@ usage_long(FILE *f)
}
void warning(char *str)
void warning(const char *str)
{
fprintf(stderr, "warning: %s\n", str);
}
@ -401,7 +401,7 @@ iperf_set_test_blksize(struct iperf_test *ipt, int blksize)
}
void
iperf_set_test_logfile(struct iperf_test *ipt, char *logfile)
iperf_set_test_logfile(struct iperf_test *ipt, const char *logfile)
{
ipt->logfile = strdup(logfile);
}
@ -496,13 +496,13 @@ iperf_set_test_role(struct iperf_test *ipt, char role)
}
void
iperf_set_test_server_hostname(struct iperf_test *ipt, char *server_hostname)
iperf_set_test_server_hostname(struct iperf_test *ipt, const char *server_hostname)
{
ipt->server_hostname = strdup(server_hostname);
}
void
iperf_set_test_template(struct iperf_test *ipt, char *tmp_template)
iperf_set_test_template(struct iperf_test *ipt, const char *tmp_template)
{
ipt->tmp_template = strdup(tmp_template);
}
@ -557,38 +557,38 @@ iperf_set_test_unit_format(struct iperf_test *ipt, char unit_format)
#if defined(HAVE_SSL)
void
iperf_set_test_client_username(struct iperf_test *ipt, char *client_username)
iperf_set_test_client_username(struct iperf_test *ipt, const char *client_username)
{
ipt->settings->client_username = strdup(client_username);
}
void
iperf_set_test_client_password(struct iperf_test *ipt, char *client_password)
iperf_set_test_client_password(struct iperf_test *ipt, const char *client_password)
{
ipt->settings->client_password = strdup(client_password);
}
void
iperf_set_test_client_rsa_pubkey(struct iperf_test *ipt, char *client_rsa_pubkey_base64)
iperf_set_test_client_rsa_pubkey(struct iperf_test *ipt, const char *client_rsa_pubkey_base64)
{
ipt->settings->client_rsa_pubkey = load_pubkey_from_base64(client_rsa_pubkey_base64);
}
void
iperf_set_test_server_authorized_users(struct iperf_test *ipt, char *server_authorized_users)
iperf_set_test_server_authorized_users(struct iperf_test *ipt, const char *server_authorized_users)
{
ipt->server_authorized_users = strdup(server_authorized_users);
}
void
iperf_set_test_server_rsa_privkey(struct iperf_test *ipt, char *server_rsa_privkey_base64)
iperf_set_test_server_rsa_privkey(struct iperf_test *ipt, const char *server_rsa_privkey_base64)
{
ipt->server_rsa_private_key = load_privkey_from_base64(server_rsa_privkey_base64);
}
#endif // HAVE_SSL
void
iperf_set_test_bind_address(struct iperf_test *ipt, char *bnd_address)
iperf_set_test_bind_address(struct iperf_test *ipt, const char *bnd_address)
{
ipt->bind_address = strdup(bnd_address);
}
@ -612,7 +612,7 @@ iperf_set_test_tos(struct iperf_test *ipt, int tos)
}
void
iperf_set_test_extra_data(struct iperf_test *ipt, char *dat)
iperf_set_test_extra_data(struct iperf_test *ipt, const char *dat)
{
ipt->extra_data = strdup(dat);
}

Просмотреть файл

@ -139,7 +139,7 @@ void iperf_set_test_reporter_interval( struct iperf_test* ipt, double reporter_i
void iperf_set_test_stats_interval( struct iperf_test* ipt, double stats_interval );
void iperf_set_test_state( struct iperf_test* ipt, signed char state );
void iperf_set_test_blksize( struct iperf_test* ipt, int blksize );
void iperf_set_test_logfile( struct iperf_test* ipt, char *logfile );
void iperf_set_test_logfile( struct iperf_test* ipt, const char *logfile );
void iperf_set_test_rate( struct iperf_test* ipt, uint64_t rate );
void iperf_set_test_pacing_timer( struct iperf_test* ipt, int pacing_timer );
void iperf_set_test_bytes( struct iperf_test* ipt, uint64_t bytes );
@ -150,27 +150,27 @@ void iperf_set_test_socket_bufsize( struct iperf_test* ipt, int socket_bufsize )
void iperf_set_test_num_streams( struct iperf_test* ipt, int num_streams );
void iperf_set_test_repeating_payload( struct iperf_test* ipt, int repeating_payload );
void iperf_set_test_role( struct iperf_test* ipt, char role );
void iperf_set_test_server_hostname( struct iperf_test* ipt, char* server_hostname );
void iperf_set_test_template( struct iperf_test *ipt, char *tmp_template );
void iperf_set_test_server_hostname( struct iperf_test* ipt, const char* server_hostname );
void iperf_set_test_template( struct iperf_test *ipt, const char *tmp_template );
void iperf_set_test_reverse( struct iperf_test* ipt, int reverse );
void iperf_set_test_json_output( struct iperf_test* ipt, int json_output );
int iperf_has_zerocopy( void );
void iperf_set_test_zerocopy( struct iperf_test* ipt, int zerocopy );
void iperf_set_test_get_server_output( struct iperf_test* ipt, int get_server_output );
void iperf_set_test_bind_address( struct iperf_test* ipt, char *bind_address );
void iperf_set_test_bind_address( struct iperf_test* ipt, const char *bind_address );
void iperf_set_test_udp_counters_64bit( struct iperf_test* ipt, int udp_counters_64bit );
void iperf_set_test_one_off( struct iperf_test* ipt, int one_off );
void iperf_set_test_tos( struct iperf_test* ipt, int tos );
void iperf_set_test_extra_data( struct iperf_test* ipt, char *dat );
void iperf_set_test_extra_data( struct iperf_test* ipt, const char *dat );
void iperf_set_test_bidirectional( struct iperf_test* ipt, int bidirectional);
void iperf_set_test_no_delay( struct iperf_test* ipt, int no_delay);
#if defined(HAVE_SSL)
void iperf_set_test_client_username(struct iperf_test *ipt, char *client_username);
void iperf_set_test_client_password(struct iperf_test *ipt, char *client_password);
void iperf_set_test_client_rsa_pubkey(struct iperf_test *ipt, char *client_rsa_pubkey_base64);
void iperf_set_test_server_authorized_users(struct iperf_test *ipt, char *server_authorized_users);
void iperf_set_test_server_rsa_privkey(struct iperf_test *ipt, char *server_rsa_privkey_base64);
void iperf_set_test_client_username(struct iperf_test *ipt, const char *client_username);
void iperf_set_test_client_password(struct iperf_test *ipt, const char *client_password);
void iperf_set_test_client_rsa_pubkey(struct iperf_test *ipt, const char *client_rsa_pubkey_base64);
void iperf_set_test_server_authorized_users(struct iperf_test *ipt, const char *server_authorized_users);
void iperf_set_test_server_rsa_privkey(struct iperf_test *ipt, const char *server_rsa_privkey_base64);
#endif // HAVE_SSL
void iperf_set_test_connect_timeout(struct iperf_test *ipt, int ct);
@ -268,7 +268,7 @@ void iperf_catch_sigend(void (*handler)(int));
void iperf_got_sigend(struct iperf_test *test) __attribute__ ((noreturn));
void usage(void);
void usage_long(FILE * f);
void warning(char *);
void warning(const char *);
int iperf_exchange_results(struct iperf_test *);
int iperf_init_test(struct iperf_test *);
int iperf_create_send_timers(struct iperf_test *);

Просмотреть файл

@ -304,7 +304,7 @@ int encode_auth_setting(const char *username, const char *password, EVP_PKEY *pu
return (0); //success
}
int decode_auth_setting(int enable_debug, char *authtoken, EVP_PKEY *private_key, char **username, char **password, time_t *ts){
int decode_auth_setting(int enable_debug, const char *authtoken, EVP_PKEY *private_key, char **username, char **password, time_t *ts){
unsigned char *encrypted_b64 = NULL;
size_t encrypted_len_b64;
Base64Decode(authtoken, &encrypted_b64, &encrypted_len_b64);

Просмотреть файл

@ -111,7 +111,7 @@ void fill_with_repeating_pattern(void *out, size_t outsize)
*/
void
make_cookie(char *cookie)
make_cookie(const char *cookie)
{
unsigned char *out = (unsigned char*)cookie;
size_t pos;
@ -402,7 +402,7 @@ iperf_json_printf(const char *format, ...)
/* Debugging routine to dump out an fd_set. */
void
iperf_dump_fdset(FILE *fp, char *str, int nfds, fd_set *fds)
iperf_dump_fdset(FILE *fp, const char *str, int nfds, fd_set *fds)
{
int fd;
int comma;

Просмотреть файл

@ -54,7 +54,7 @@ const char* get_optional_features(void);
cJSON* iperf_json_printf(const char *format, ...);
void iperf_dump_fdset(FILE *fp, char *str, int nfds, fd_set *fds);
void iperf_dump_fdset(FILE *fp, const char *str, int nfds, fd_set *fds);
#ifndef HAVE_DAEMON
extern int daemon(int nochdir, int noclose);

Просмотреть файл

@ -121,7 +121,7 @@ timeout_connect(int s, const struct sockaddr *name, socklen_t namelen,
/* make connection to server */
int
netdial(int domain, int proto, char *local, int local_port, char *server, int port, int timeout)
netdial(int domain, int proto, const char *local, int local_port, const char *server, int port, int timeout)
{
struct addrinfo hints, *local_res, *server_res;
int s, saved_errno;
@ -218,7 +218,7 @@ netdial(int domain, int proto, char *local, int local_port, char *server, int po
/***************************************************************/
int
netannounce(int domain, int proto, char *local, int port)
netannounce(int domain, int proto, const char *local, int port)
{
struct addrinfo hints, *res;
char portstr[6];

Просмотреть файл

@ -28,8 +28,8 @@
#define __NET_H
int timeout_connect(int s, const struct sockaddr *name, socklen_t namelen, int timeout);
int netdial(int domain, int proto, char *local, int local_port, char *server, int port, int timeout);
int netannounce(int domain, int proto, char *local, int port);
int netdial(int domain, int proto, const char *local, int local_port, const char *server, int port, int timeout);
int netannounce(int domain, int proto, const char *local, int port);
int Nread(int fd, char *buf, size_t count, int prot);
int Nwrite(int fd, const char *buf, size_t count, int prot) /* __attribute__((hot)) */;
int has_sendfile(void);