Re: [PATCH] oidset: don't return value from oidset_init

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am 09.01.2018 um 00:26 schrieb Junio C Hamano:
Thomas Gummerer <t.gummerer@xxxxxxxxx> writes:

c3a9ad3117 ("oidset: add iterator methods to oidset", 2017-11-21)
introduced a 'oidset_init()' function in oidset.h, which has void as
return type, but returns an expression.
...
diff --git a/oidset.h b/oidset.h
index 783abceccd..40ec5f87fe 100644
--- a/oidset.h
+++ b/oidset.h
@@ -27,7 +27,7 @@ struct oidset {
static inline void oidset_init(struct oidset *set, size_t initial_size)
  {
-	return oidmap_init(&set->map, initial_size);
+	oidmap_init(&set->map, initial_size);
  }

Makes sense.  Perhaps "inline" hids this from error-checking
compilers, I wonder?

outmap_init returns void itself. It is a modern language feature, I guess, that this void "value" can be forwarded in a return statement.

-- Hannes



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux