Centralize the signed and unsigned integer parse checks to avoid code
duplication. The diffstat isn't very impressive at this point, but this
will help more when adding 8-bit and 16-bit integer tests.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>