chiark / gitweb /
Add nonnull attribute to a few function args.
authorRichard Kettlewell <rjk@greenend.org.uk>
Sun, 13 Sep 2015 11:06:31 +0000 (12:06 +0100)
committerRichard Kettlewell <rjk@greenend.org.uk>
Sun, 13 Sep 2015 11:06:31 +0000 (12:06 +0100)
lib/addr.h
lib/eventlog.h

index 6b3991f123ae5ac42070ee9e2052550db62d8f13..385259d00a4e06a6dd36d1988c2e688dbdf2af4b 100644 (file)
@@ -45,25 +45,26 @@ struct netaddress {
 
 struct addrinfo *get_address(const struct stringlist *a,
                             const struct addrinfo *pref,
-                            char **namep);
+                            char **namep)
+  attribute((nonnull (1)));
 
 int addrinfocmp(const struct addrinfo *a,
-               const struct addrinfo *b);
+               const struct addrinfo *b) attribute((nonnull (1, 2)));
 int sockaddrcmp(const struct sockaddr *a,
-               const struct sockaddr *b);
+               const struct sockaddr *b) attribute((nonnull (1, 2)));
 
-int multicast(const struct sockaddr *sa);
-char *format_sockaddr(const struct sockaddr *sa);
+int multicast(const struct sockaddr *sa) attribute((nonnull (1)));
+char *format_sockaddr(const struct sockaddr *sa) attribute((nonnull (1)));
 
 int netaddress_parse(struct netaddress *na,
                     int nvec,
-                    char **vec);
+                    char **vec) attribute((nonnull (1)));
 void netaddress_format(const struct netaddress *na,
                       int *nvecp,
-                      char ***vecp);
+                      char ***vecp) attribute((nonnull (1)));
 struct addrinfo *netaddress_resolve(const struct netaddress *na,
                                    int passive,
-                                   int protocol);
+                                   int protocol) attribute((nonnull (1)));
 
 #endif /* ADDR_H */
 
index e29fcfc7db300c13fb9d4c1c46f4a3c0b55dd1b9..64154d11270b1e1aeaf747fcd965dcfb9fc95592 100644 (file)
@@ -41,25 +41,26 @@ struct eventlog_output {
 /** @brief Add an event log output
  * @param lo Pointer to output to add
  */
-void eventlog_add(struct eventlog_output *lo);
+void eventlog_add(struct eventlog_output *lo) attribute((nonnull(1)));
 
 /** @brief Remove an event log output
  * @param lo Pointer to output to remove
  */
-void eventlog_remove(struct eventlog_output *lo);
+void eventlog_remove(struct eventlog_output *lo) attribute((nonnull(1)));
 
 /** @brief Send a message to the event log
  * @param keyword Distinguishing keyword for event
  * @param ... Extra data, terminated by (char *)0
  */
-void eventlog(const char *keyword, ...);
+void eventlog(const char *keyword, ...) attribute((nonnull(1)));
 
 /** @brief Send a message to the event log
  * @param keyword Distinguishing keyword for event
  * @param raw Unformatted data
  * @param ... Extra data, terminated by (char *)0
  */
-void eventlog_raw(const char *keyword, const char *raw, ...);
+void eventlog_raw(const char *keyword, const char *raw, ...)
+  attribute((nonnull(1, 2)));
 
 #endif /* EVENTLOG_H */