Skip to content

Commit

Permalink
Merge pull request #282 from zowe/bugfix/json-debug-v1
Browse files Browse the repository at this point in the history
Fix collision with debug ifdef
  • Loading branch information
1000TurquoisePogs authored Mar 23, 2022
2 parents a0b4e2c + 314b65a commit 16b588c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions c/json.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
# define SOURCE_CODE_CHARSET CCSID_UTF_8
#endif

#define DEBUG(...) /* fprintf(stderr, __VA_ARGS__) */
#define JSON_DEBUG(...) /* fprintf(stderr, __VA_ARGS__) */
#define DUMPBUF($b, $l) /* dumpBufferToStream($b, $l, stderr) */

#ifdef METTLE
Expand Down Expand Up @@ -158,7 +158,7 @@ void jsonWriteBufferInternal(jsonPrinter *p, char *text, int len) {
if (jsonShouldStopWriting(p)) {
return;
}
DEBUG("write buffer internal: text at %p, len %d\n", text, len);
JSON_DEBUG("write buffer internal: text at %p, len %d\n", text, len);
DUMPBUF(text, len);
if (p->isCustom) {
p->customWrite(p, text, len);
Expand Down Expand Up @@ -294,7 +294,7 @@ writeBufferWithEscaping(jsonPrinter *p, size_t len, char text[len]) {
ERROR("JSON: invalid UTF-8, rc %d\n", getCharErr);
return -1;
}
DEBUG("character at %p + %d, len %d, char %x\n", text, i, len, utf8Char);
JSON_DEBUG("character at %p + %d, len %d, char %x\n", text, i, len, utf8Char);
if (((utf8Char >= 0) && (utf8Char <= effectiveControlCharBoundary))
|| (utf8Char == UTF8_BACKSLASH) || (utf8Char == UTF8_QUOTE)) {

Expand Down Expand Up @@ -358,15 +358,15 @@ void jsonConvertAndWriteBuffer(jsonPrinter *p, char *text, size_t len,
if (inputCCSID != CCSID_UTF_8) {
ssize_t newLen;

DEBUG("before conversion, len %d:\n", len);
JSON_DEBUG("before conversion, len %d:\n", len);
DUMPBUF(text, len);
newLen = convertToUtf8(p, len, text, inputCCSID);
if (newLen < 0) {
ERROR("jsonConvertAndWriteBuffer() error: newLen = %d\n",
newLen);
return;
}
DEBUG("utf8, len %d:\n", newLen);
JSON_DEBUG("utf8, len %d:\n", newLen);
text = p->_conversionBuffer;
len = newLen;
DUMPBUF(text, len);
Expand Down

0 comments on commit 16b588c

Please sign in to comment.