Skip to content

Commit 2189067

Browse files
AZero13millert
authored andcommitted
Remove restrict noise
Turns out they don't have effect in many places.
1 parent 0a66e8c commit 2189067

File tree

10 files changed

+27
-27
lines changed

10 files changed

+27
-27
lines changed

include/sudo_util.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ sudo_dso_public int sudo_mmap_protect_v1(void *ptr);
262262
#define sudo_mmap_protect(_a) sudo_mmap_protect_v1(_a)
263263

264264
/* multiarch.c */
265-
sudo_dso_public char *sudo_stat_multiarch_v1(const char * restrict path, struct stat * restrict sb);
265+
sudo_dso_public char *sudo_stat_multiarch_v1(const char *path, struct stat *sb);
266266
#define sudo_stat_multiarch(_a, _b) sudo_stat_multiarch_v1((_a), (_b))
267267

268268
/* parseln.c */

lib/eventlog/logwrap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#include <sudo_eventlog.h>
2929

3030
size_t
31-
eventlog_writeln(FILE * restrict fp, char * restrict line, size_t linelen, size_t maxlen)
31+
eventlog_writeln(FILE *fp, char *line, size_t linelen, size_t maxlen)
3232
{
3333
const char *indent = "";
3434
char *beg = line;

lib/util/multiarch.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
* Returns a dynamically allocated string on success and NULL on failure.
4040
*/
4141
char *
42-
sudo_stat_multiarch_v1(const char * restrict path, struct stat * restrict sb)
42+
sudo_stat_multiarch_v1(const char *path, struct stat *sb)
4343
{
4444
# if defined(__ILP32__)
4545
const char *libdirs[] = { "/libx32/", "/lib/", "/libexec/", NULL };
@@ -91,7 +91,7 @@ sudo_stat_multiarch_v1(const char * restrict path, struct stat * restrict sb)
9191
}
9292
#else
9393
char *
94-
sudo_stat_multiarch_v1(const char * restrict path, struct stat * restrict sb)
94+
sudo_stat_multiarch_v1(const char *path, struct stat *sb)
9595
{
9696
return NULL;
9797
}

lib/util/ttyname_dev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ sudo_ttyname_scan(const char *dir, dev_t rdev, char *name, size_t namelen)
216216
}
217217

218218
static char *
219-
sudo_dev_check(dev_t rdev, const char * restrict devname, char * restrict buf, size_t buflen)
219+
sudo_dev_check(dev_t rdev, const char *devname, char *buf, size_t buflen)
220220
{
221221
struct stat sb;
222222
debug_decl(sudo_dev_check, SUDO_DEBUG_UTIL);

logsrvd/logsrvd_journal.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -527,8 +527,8 @@ journal_restart(const RestartMessage *msg, const uint8_t *buf, size_t buflen,
527527
}
528528

529529
static bool
530-
journal_write(const uint8_t * restrict buf, size_t len,
531-
struct connection_closure * restrict closure)
530+
journal_write(const uint8_t *buf, size_t len,
531+
struct connection_closure *closure)
532532
{
533533
uint32_t msg_len;
534534
debug_decl(journal_write, SUDO_DEBUG_UTIL);
@@ -597,8 +597,8 @@ journal_accept(const AcceptMessage *msg, const uint8_t *buf, size_t len,
597597
* Store a RejectMessage from the client in the journal.
598598
*/
599599
static bool
600-
journal_reject(const RejectMessage *msg, const uint8_t * restrict buf,
601-
size_t len, struct connection_closure * restrict closure)
600+
journal_reject(const RejectMessage *msg, const uint8_t *buf,
601+
size_t len, struct connection_closure *closure)
602602
{
603603
debug_decl(journal_reject, SUDO_DEBUG_UTIL);
604604

@@ -617,8 +617,8 @@ journal_reject(const RejectMessage *msg, const uint8_t * restrict buf,
617617
* Store an ExitMessage from the client in the journal.
618618
*/
619619
static bool
620-
journal_exit(const ExitMessage *msg, const uint8_t * restrict buf, size_t len,
621-
struct connection_closure * restrict closure)
620+
journal_exit(const ExitMessage *msg, const uint8_t *buf, size_t len,
621+
struct connection_closure *closure)
622622
{
623623
debug_decl(journal_exit, SUDO_DEBUG_UTIL);
624624

@@ -635,8 +635,8 @@ journal_exit(const ExitMessage *msg, const uint8_t * restrict buf, size_t len,
635635
* Store an AlertMessage from the client in the journal.
636636
*/
637637
static bool
638-
journal_alert(const AlertMessage *msg, const uint8_t * restrict buf, size_t len,
639-
struct connection_closure * restrict closure)
638+
journal_alert(const AlertMessage *msg, const uint8_t *buf, size_t len,
639+
struct connection_closure *closure)
640640
{
641641
debug_decl(journal_alert, SUDO_DEBUG_UTIL);
642642

@@ -655,8 +655,8 @@ journal_alert(const AlertMessage *msg, const uint8_t * restrict buf, size_t len,
655655
* Store an IoBuffer from the client in the journal.
656656
*/
657657
static bool
658-
journal_iobuf(int iofd, const IoBuffer *iobuf, const uint8_t * restrict buf,
659-
size_t len, struct connection_closure * restrict closure)
658+
journal_iobuf(int iofd, const IoBuffer *iobuf, const uint8_t *buf,
659+
size_t len, struct connection_closure *closure)
660660
{
661661
debug_decl(journal_iobuf, SUDO_DEBUG_UTIL);
662662

@@ -671,8 +671,8 @@ journal_iobuf(int iofd, const IoBuffer *iobuf, const uint8_t * restrict buf,
671671
* Store a CommandSuspend message from the client in the journal.
672672
*/
673673
static bool
674-
journal_suspend(const CommandSuspend *msg, const uint8_t * restrict buf,
675-
size_t len, struct connection_closure * restrict closure)
674+
journal_suspend(const CommandSuspend *msg, const uint8_t *buf,
675+
size_t len, struct connection_closure *closure)
676676
{
677677
debug_decl(journal_suspend, SUDO_DEBUG_UTIL);
678678

@@ -685,8 +685,8 @@ journal_suspend(const CommandSuspend *msg, const uint8_t * restrict buf,
685685
* Store a ChangeWindowSize message from the client in the journal.
686686
*/
687687
static bool
688-
journal_winsize(const ChangeWindowSize *msg, const uint8_t * restrict buf,
689-
size_t len, struct connection_closure * restrict closure)
688+
journal_winsize(const ChangeWindowSize *msg, const uint8_t *buf,
689+
size_t len, struct connection_closure *closure)
690690
{
691691
debug_decl(journal_winsize, SUDO_DEBUG_UTIL);
692692

plugins/audit_json/audit_json.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ add_timestamp(struct json_container *jsonc, struct timespec *ts)
383383
}
384384

385385
static int
386-
audit_write_json(struct json_container * restrict jsonc)
386+
audit_write_json(struct json_container *jsonc)
387387
{
388388
struct stat sb;
389389
int ret = -1;

plugins/sudoers/cvtsudoers.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1079,7 +1079,7 @@ print_aliases_sudoers(struct sudoers_parse_tree *parse_tree,
10791079
static FILE *output_fp; /* global for convert_sudoers_output */
10801080

10811081
static int
1082-
convert_sudoers_output(const char * restrict buf)
1082+
convert_sudoers_output(const char *buf)
10831083
{
10841084
return fputs(buf, output_fp);
10851085
}

plugins/sudoers/cvtsudoers_csv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ defaults_to_alias_type(int defaults_type)
107107
* XXX - rewrite this
108108
*/
109109
static bool
110-
print_csv_string(FILE * restrict fp, const char * restrict str, bool quoted)
110+
print_csv_string(FILE *fp, const char *str, bool quoted)
111111
{
112112
const char *src = str;
113113
char *dst, *newstr;

plugins/sudoers/testsudoers.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ enum sudoers_formats {
6565
static void dump_sudoers(void);
6666
static void set_runaspw(struct sudoers_context *ctx, const char *);
6767
static void set_runasgr(struct sudoers_context *ctx, const char *);
68-
static int testsudoers_error(const char * restrict buf);
69-
static int testsudoers_output(const char * restrict buf);
68+
static int testsudoers_error(const char *buf);
69+
static int testsudoers_output(const char *buf);
7070
sudo_noreturn static void usage(void);
7171
static void cb_lookup(const struct sudoers_parse_tree *parse_tree, const struct userspec *us, int user_match, const struct privilege *priv, int host_match, const struct cmndspec *cs, int date_match, int runas_match, int cmnd_match, void *closure);
7272
static int testsudoers_query(struct sudoers_context *ctx, const struct sudo_nss *nss, struct passwd *pw);
@@ -744,13 +744,13 @@ dump_sudoers(void)
744744
}
745745

746746
static int
747-
testsudoers_output(const char * restrict buf)
747+
testsudoers_output(const char *buf)
748748
{
749749
return fputs(buf, stdout);
750750
}
751751

752752
static int
753-
testsudoers_error(const char *restrict buf)
753+
testsudoers_error(const char *buf)
754754
{
755755
return fputs(buf, stderr);
756756
}

src/parse_args.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -756,7 +756,7 @@ usage_excl_ticket(void)
756756
}
757757

758758
static int
759-
help_out(const char * restrict buf)
759+
help_out(const char *buf)
760760
{
761761
return fputs(buf, stdout);
762762
}

0 commit comments

Comments
 (0)