[libxml2] Fix compiler warnings in SAX2.c



commit 81621b1fe4c7a0e15e2a287b3ae4a3a7bfdbee20
Author: Nick Wellnhofer <wellnhofer aevum de>
Date:   Fri Sep 2 18:38:33 2022 +0200

    Fix compiler warnings in SAX2.c

 SAX2.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/SAX2.c b/SAX2.c
index 3ed2e549..3d75751e 100644
--- a/SAX2.c
+++ b/SAX2.c
@@ -1642,7 +1642,7 @@ xmlSAX2StartElement(void *ctx, const xmlChar *fullname, const xmlChar **atts)
     ctxt->nodemem = -1;
     if (ctxt->linenumbers) {
        if (ctxt->input != NULL) {
-           if (ctxt->input->line < USHRT_MAX)
+           if ((unsigned) ctxt->input->line < (unsigned) USHRT_MAX)
                ret->line = ctxt->input->line;
            else
                ret->line = USHRT_MAX;
@@ -1907,7 +1907,7 @@ skip:
 
     if (ctxt->linenumbers) {
        if (ctxt->input != NULL) {
-           if (ctxt->input->line < USHRT_MAX)
+           if ((unsigned) ctxt->input->line < (unsigned) USHRT_MAX)
                ret->line = ctxt->input->line;
            else {
                ret->line = USHRT_MAX;
@@ -2285,7 +2285,7 @@ xmlSAX2StartElementNs(void *ctx,
     }
     if (ctxt->linenumbers) {
        if (ctxt->input != NULL) {
-           if (ctxt->input->line < USHRT_MAX)
+           if ((unsigned) ctxt->input->line < (unsigned) USHRT_MAX)
                ret->line = ctxt->input->line;
            else
                ret->line = USHRT_MAX;
@@ -2710,7 +2710,7 @@ xmlSAX2ProcessingInstruction(void *ctx, const xmlChar *target,
 
     if (ctxt->linenumbers) {
        if (ctxt->input != NULL) {
-           if (ctxt->input->line < USHRT_MAX)
+           if ((unsigned) ctxt->input->line < (unsigned) USHRT_MAX)
                ret->line = ctxt->input->line;
            else
                ret->line = USHRT_MAX;
@@ -2770,7 +2770,7 @@ xmlSAX2Comment(void *ctx, const xmlChar *value)
     if (ret == NULL) return;
     if (ctxt->linenumbers) {
        if (ctxt->input != NULL) {
-           if (ctxt->input->line < USHRT_MAX)
+           if ((unsigned) ctxt->input->line < (unsigned) USHRT_MAX)
                ret->line = ctxt->input->line;
            else
                ret->line = USHRT_MAX;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]