From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59603) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ai3ye-0006us-ND for qemu-devel@nongnu.org; Mon, 21 Mar 2016 13:50:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ai3yb-0007Jm-Q1 for qemu-devel@nongnu.org; Mon, 21 Mar 2016 13:50:52 -0400 Received: from mail-wm0-x22c.google.com ([2a00:1450:400c:c09::22c]:34959) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ai3yb-0007Jf-Fu for qemu-devel@nongnu.org; Mon, 21 Mar 2016 13:50:49 -0400 Received: by mail-wm0-x22c.google.com with SMTP id l68so120474806wml.0 for ; Mon, 21 Mar 2016 10:50:49 -0700 (PDT) Sender: Paolo Bonzini References: <1458494179-7165-1-git-send-email-veroniabahaa@gmail.com> From: Paolo Bonzini Message-ID: <56F03477.6090008@redhat.com> Date: Mon, 21 Mar 2016 18:50:47 +0100 MIME-Version: 1.0 In-Reply-To: <1458494179-7165-1-git-send-email-veroniabahaa@gmail.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH] util: move declarations out of qemu-common.h List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: veroniabahaa@gmail.com, qemu-devel@nongnu.org There are only two issues with the patch, which I fixed before queuing it for my next pull request. On 20/03/2016 18:16, veroniabahaa@gmail.com wrote: > -/* path.c */ > -void init_paths(const char *prefix); > -const char *path(const char *pathname); The first is that only the above two lines were really for path.c, so I have removed everything else from path.h. Likewise, unicode.c only has mod_utf8_codepoint. > -/* unicode.c */ > -int mod_utf8_codepoint(const char *s, size_t n, char **end); > - > -/* > - * Hexdump a buffer to a file. An optional string prefix is added to every line > - */ > - > -void qemu_hexdump(const char *buf, FILE *fp, const char *prefix, size_t size); > - > /* vector definitions */ > #ifdef __ALTIVEC__ > #include > diff --git a/include/qemu/bcd.h b/include/qemu/bcd.h > new file mode 100644 > index 0000000..7e720c4 > --- /dev/null > +++ b/include/qemu/bcd.h > @@ -0,0 +1,10 @@ > +/* Convert a byte between binary and BCD. */ > +static inline uint8_t to_bcd(uint8_t val) > +{ > + return ((val / 10) << 4) | (val % 10); > +} > + > +static inline uint8_t from_bcd(uint8_t val) > +{ > + return ((val >> 4) * 10) + (val & 0x0f); > +} The second is that you need multiple-inclusion guards here, like #ifndef QEMU_BCD_H #define QEMU_BCD_H 1 /* Convert a byte between binary and BCD. */ static inline uint8_t to_bcd(uint8_t val) { return ((val / 10) << 4) | (val % 10); } static inline uint8_t from_bcd(uint8_t val) { return ((val >> 4) * 10) + (val & 0x0f); } #endif That said, great job, considering that even just creating qemu/bcd.h would have been enough. Instead, you went ahead and touched 140 files. Thanks! Paolo