From: <svn...@op...> - 2010-10-15 15:07:01
|
Author: bellmich Date: Fri Oct 15 17:06:51 2010 New Revision: 231 URL: http://libwbxml.opensync.org/changeset/231 Log: - fixed ignored parameter flow_mode in wbxml_encoder - fixed several warnings Modified: wbxml2/trunk/src/wbxml_buffers.c wbxml2/trunk/src/wbxml_encoder.c wbxml2/trunk/src/wbxml_parser.c Modified: wbxml2/trunk/src/wbxml_buffers.c ============================================================================== --- wbxml2/trunk/src/wbxml_buffers.c Tue Oct 12 15:10:30 2010 (r230) +++ wbxml2/trunk/src/wbxml_buffers.c Fri Oct 15 17:06:51 2010 (r231) @@ -167,7 +167,7 @@ WBXML_DECLARE(WB_BOOL) wbxml_buffer_get_char(WBXMLBuffer *buffer, WB_ULONG pos, WB_UTINY *result) { - if ((buffer == NULL) || (pos >= buffer->len) || (pos < 0)) + if ((buffer == NULL) || (pos >= buffer->len)) return FALSE; *result = buffer->data[pos]; @@ -359,8 +359,7 @@ if ((len = wbxml_buffer_len(buffer)) > 0) { end = len = len - 1; while (wbxml_buffer_get_char(buffer, end, &ch) && - isspace(ch) && - end >= 0) + isspace(ch)) { end--; } @@ -706,7 +705,7 @@ */ static WB_BOOL grow_buff(WBXMLBuffer *buffer, WB_ULONG size) { - if ((buffer == NULL) || buffer->is_static || (size < 0)) + if ((buffer == NULL) || buffer->is_static) return FALSE; /* Make room for the invisible terminating NUL */ Modified: wbxml2/trunk/src/wbxml_encoder.c ============================================================================== --- wbxml2/trunk/src/wbxml_encoder.c Tue Oct 12 15:10:30 2010 (r230) +++ wbxml2/trunk/src/wbxml_encoder.c Fri Oct 15 17:06:51 2010 (r231) @@ -625,10 +625,14 @@ if (encoder == NULL) return WBXML_ERROR_BAD_PARAMETER; - encoder->flow_mode = TRUE; + encoder->flow_mode = flow_mode; - /* Don't use String Tables */ - wbxml_encoder_set_use_strtbl(encoder, FALSE); + /* The string tables must only be disabled during flow mode. */ + if (flow_mode) + { + /* Don't use String Tables */ + wbxml_encoder_set_use_strtbl(encoder, FALSE); + } return WBXML_OK; } @@ -3023,7 +3027,8 @@ static WBXMLError wbxml_encode_wv_integer(WBXMLEncoder *encoder, WB_UTINY *buffer) { WB_UTINY octets[4]; - WB_ULONG the_int = 0, i = 0, start = 0; + WB_ULONG the_int = 0, start = 0; + WB_LONG i = 0; if ((encoder == NULL) || (buffer == NULL)) return WBXML_ERROR_INTERNAL; Modified: wbxml2/trunk/src/wbxml_parser.c ============================================================================== --- wbxml2/trunk/src/wbxml_parser.c Tue Oct 12 15:10:30 2010 (r230) +++ wbxml2/trunk/src/wbxml_parser.c Fri Oct 15 17:06:51 2010 (r231) @@ -242,8 +242,9 @@ ret = parse_version(parser); CHECK_ERROR - if ((WB_UTINY)parser->version > WBXML_VERSION_13) + if ((WB_UTINY)parser->version > WBXML_VERSION_13) { WBXML_WARNING((WBXML_PARSER, "This library only supports WBXML " WBXML_VERSION_TEXT_13)); + } /* WBXML Public ID */ ret = parse_publicid(parser); @@ -1094,8 +1095,9 @@ { WBXML_DEBUG((WBXML_PARSER, "(%d) Parsing switchPage", parser->pos)); - if ((WB_UTINY) parser->version < (WB_UTINY) WBXML_VERSION_12) + if ((WB_UTINY) parser->version < (WB_UTINY) WBXML_VERSION_12) { WBXML_WARNING((WBXML_PARSER, "No Switch Page mecanism possible in WBXML < %s (current: %d)", WBXML_VERSION_TEXT_12, (WB_UTINY) parser->version)); + } /* Skip SWITCH_PAGE token */ parser->pos++; @@ -1746,8 +1748,9 @@ WBXML_DEBUG((WBXML_PARSER, "(%d) Parsing opaque", parser->pos)); - if (parser->version < WBXML_VERSION_11) + if (parser->version < WBXML_VERSION_11) { WBXML_WARNING((WBXML_PARSER, "No 'opaque' support in WBXML < %s", WBXML_VERSION_TEXT_11)); + } /* Skip OPAQUE */ parser->pos++; |