This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project gfxprim.git.
The branch, master has been updated via 50ac1f21f85e66b3d2a8a0a6047971c474c250a4 (commit) from 2274cefa956331bb30fc65f72522f7a4d4ec0e28 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- http://repo.or.cz/w/gfxprim.git/commit/50ac1f21f85e66b3d2a8a0a6047971c474c25...
commit 50ac1f21f85e66b3d2a8a0a6047971c474c250a4 Author: BlueBear jiri.bluebear.dluhos@gmail.com Date: Thu May 5 22:15:20 2011 +0200
Added the GP_BUG_ON macro.
diff --git a/core/GP_Common.h b/core/GP_Common.h index 6f06121..b93e921 100644 --- a/core/GP_Common.h +++ b/core/GP_Common.h @@ -50,6 +50,18 @@ })
/* + * Checks the condition and aborts immediately if it is true, + * printing the condition and location in the source. + */ +#define GP_BUG_ON(test) do { + if ((test)) { + fprintf(stderr, "*** gfxprim: BUG: %s:%d: in %s: %sn", + __FILE__, __LINE__, __FUNCTION__, #test); + abort(); + } + } while (0) + +/* * Abort and print abort location to stderr */ #define GP_ABORT(msg) do { -----------------------------------------------------------------------
Summary of changes: core/GP_Common.h | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos@gmail.com if you want to unsubscribe, or site admin admin@repo.or.cz if you receive no reply.
Ahoj!
Tak premyslim - jaky je zamysleny ucel GP_BUG_ON oproti GP_CHECK? (krom obracene podminky) Pokud je mezi nimi nejaky hlubsi semanticky rozdil, nahradime pul GP_CHECKU za GP_BUG_ON?
Mejte se krasne, Tomas
On Thu, May 5, 2011 at 10:17 PM, bluebear jiri.bluebear.dluhos@gmail.com wrote:
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project gfxprim.git.
The branch, master has been updated via 50ac1f21f85e66b3d2a8a0a6047971c474c250a4 (commit) from 2274cefa956331bb30fc65f72522f7a4d4ec0e28 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log -----------------------------------------------------------------
http://repo.or.cz/w/gfxprim.git/commit/50ac1f21f85e66b3d2a8a0a6047971c474c25...
commit 50ac1f21f85e66b3d2a8a0a6047971c474c250a4 Author: BlueBear jiri.bluebear.dluhos@gmail.com Date: Thu May 5 22:15:20 2011 +0200
Added the GP_BUG_ON macro.
diff --git a/core/GP_Common.h b/core/GP_Common.h index 6f06121..b93e921 100644 --- a/core/GP_Common.h +++ b/core/GP_Common.h @@ -50,6 +50,18 @@ })
/*
- Checks the condition and aborts immediately if it is true,
- printing the condition and location in the source.
- */
+#define GP_BUG_ON(test) do { + if ((test)) { + fprintf(stderr, "*** gfxprim: BUG: %s:%d: in %s: %sn", + __FILE__, __LINE__, __FUNCTION__, #test); + abort(); + } + } while (0)
+/* * Abort and print abort location to stderr */ #define GP_ABORT(msg) do {
Summary of changes: core/GP_Common.h | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos@gmail.com if you want to unsubscribe, or site admin admin@repo.or.cz if you receive no reply. -- gfxprim.git ("A simple 2D graphics library with emphasis on correctness and well-defined operation.") _______________________________________________ Gfxprim mailing list Gfxprim@ucw.cz http://www.ucw.cz/mailman/listinfo/gfxprim
On 05/05/2011 11:22 PM, Tomas Gavenciak wrote:
Ahoj!
Tak premyslim - jaky je zamysleny ucel GP_BUG_ON oproti GP_CHECK? (krom obracene podminky) Pokud je mezi nimi nejaky hlubsi semanticky rozdil, nahradime pul GP_CHECKU za GP_BUG_ON?
Mejte se krasne, Tomas
Hi,
GP_BUG_ON was meant to check for bugs that are internal for the library (something *we* have to fix :-) ).
GP_CHECK is meant for errors caused by the user (something *they* have to fix :-) )
To remove the inconsistency where GP_BUG_ON expects an inverted condition, I have renamed it to GP_ASSERT, and added a second parameter, a human-friendly message, to GP_CHECK. (GP_ASSERT does not need a human-friendly message as it is us who have to make sense of it.)
Thank you for pointing this out,
Best regards,
Jiri Dluhos