Skip to content
Snippets Groups Projects
  1. Nov 02, 2017
    • Will Thompson's avatar
      errors: don't use 'static inline' on varargs functions · 016ea916
      Will Thompson authored
      This caused GCC 6.3.0 -Winline to complain:
      
          ../../../ext/libglnx/glnx-errors.h:169:1: warning: function
              ‘glnx_throw_errno_prefix’ can never be inlined because it uses
              variable argument lists [-Winline]
           glnx_throw_errno_prefix (GError **error, const char *fmt, ...)
           ^~~~~~~~~~~~~~~~~~~~~~~
          ../../../ext/libglnx/glnx-errors.h:169:1: warning: inlining failed
              in call to ‘glnx_throw_errno_prefix’: function not inlinable
              [-Winline]
      Unverified
      016ea916
  2. Jul 21, 2017
    • Jonathan Lebon's avatar
      errors: check for an error before prefixing · c820571b
      Jonathan Lebon authored
      Minor tweak to the new `GLNX_AUTO_PREFIX_ERROR`. Since the common case
      is that there's no errors, let's bring down the same check that
      `g_prefix_error` does to avoid a function call most of the time.
      c820571b
  3. Jul 20, 2017
  4. Jul 17, 2017
    • Colin Walters's avatar
      errors: Add GLNX_AUTO_PREFIX_ERROR · 607f1775
      Colin Walters authored
      In a lot of places in ostree, we end up prefixing errors in the *caller*.
      Often we only have 1-2 callers, and doing the error prefixing isn't
      too duplicative.  But there are definitely cases where it's cleaner
      to do the prefixing in the callee.  We have functions that aren't
      ported to new style for this reason (they still do the prefixing
      in `out:`).
      
      Introduce a cleanup-oriented version of error prefixing so we can port those
      functions too.
      607f1775
  5. May 11, 2017
  6. Mar 24, 2017
  7. Mar 23, 2017
    • Jonathan Lebon's avatar
      glnx-errors.h: add glnx_null_throw[_*] variants · 0c52d85e
      Jonathan Lebon authored
      These are equivalent to the non-null throw, except that the returned
      value is a NULL pointer. They can be used in functions where one wants
      to return a pointer. E.g.:
      
      	GKeyFile *foo(GError **error) {
      		return glnx_null_throw (error, "foobar");
      	}
      
      The function call redirections are wrapped around a compound statement
      expression[1] so that they represent a single top-level expression. This
      allows us to avoid -Wunused-value warnings vs using a comma operator if
      the return value isn't used.
      
      I made the 'args...' absorb the fmt argument as well so that callers can
      still use it without always having to specify at least one additional
      variadic argument. I had to check to be sure that the expansion is all
      done by the preprocessor, so we don't need to worry about stack
      intricacies.
      
      [1] https://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html
      0c52d85e
  8. Mar 22, 2017
  9. Feb 18, 2015
  10. Feb 15, 2015
Loading