mirror of
git://git.psyc.eu/libpsyc
synced 2024-08-15 03:19:02 +00:00
added assert for render, removed LPC assert
This commit is contained in:
parent
d1d4e3c516
commit
a253f96283
4 changed files with 6 additions and 16 deletions
|
@ -3,7 +3,7 @@
|
|||
|
||||
#ifdef DEBUG
|
||||
# include <stdio.h>
|
||||
# define PP(args) printf args;
|
||||
# define PP(args) printf(args);
|
||||
#else
|
||||
# define PP(args)
|
||||
#endif
|
||||
|
@ -82,18 +82,4 @@
|
|||
# define P4(MSG)
|
||||
#endif
|
||||
|
||||
// ASSERT() unused as yet
|
||||
#if DEBUG > 0
|
||||
# ifdef STRICT
|
||||
# define ASSERT(NAME,COND,VALUE) { unless (COND) { \
|
||||
PP(("Assertion %s failed in %s: %s\n", NAME, ME, VALUE)); \
|
||||
raise_error("Assertion failed (strict mode).\n"); } }
|
||||
# else
|
||||
# define ASSERT(NAME,COND,VALUE) { unless (COND) \
|
||||
PP(("Assertion %s failed in %s: %s\n", NAME, ME, VALUE)); }
|
||||
# endif
|
||||
#else
|
||||
# define ASSERT(NAME,CONDITION,VALUE)
|
||||
#endif
|
||||
|
||||
#endif // DEBUG_H
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
#include "../psyc.h"
|
||||
#include "./debug.h"
|
||||
#include <sys/cdefs.h>
|
||||
#include <assert.h>
|
||||
|
||||
/* perlisms for readability */
|
||||
#define unless(COND) if (!(COND))
|
||||
|
|
|
@ -58,6 +58,9 @@ PSYC_RenderRC PSYC_render(PSYC_Packet *packet, char *buffer, size_t buflen)
|
|||
}
|
||||
|
||||
memcpy(buffer + cur, PSYC_PACKET_DELIMITER + 1, 2);
|
||||
cur += 2;
|
||||
|
||||
assert(cur == packet->length);
|
||||
return PSYC_RENDER_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ int writePresence(const char *avail, int availlen, const char *desc, int desclen
|
|||
PSYC_newModifier2(C_GLYPH_OPERATOR_SET, PSYC_C2ARG("_source"), PSYC_C2ARG(myUNI),
|
||||
PSYC_MODIFIER_ROUTING),
|
||||
PSYC_newModifier2(C_GLYPH_OPERATOR_SET, PSYC_C2ARG("_context"), PSYC_C2ARG(myUNI),
|
||||
PSYC_MODIFIER_CHECK_LENGTH),
|
||||
PSYC_MODIFIER_ROUTING),
|
||||
};
|
||||
|
||||
PSYC_Modifier entity[] = {
|
||||
|
|
Loading…
Reference in a new issue