xpath BUGFIX xpath element count uses uint32_t

Fixes sysrepo/sysrepo#2277
diff --git a/src/xpath.c b/src/xpath.c
index 49d5aa8..89aa0d0 100644
--- a/src/xpath.c
+++ b/src/xpath.c
@@ -135,7 +135,7 @@
 {
 #define MSG_BUFFER_SIZE 128
     char tmp[MSG_BUFFER_SIZE];
-    uint16_t i, j;
+    uint32_t i, j;
 
     if (!exp || (ly_ll < LY_LLDBG)) {
         return;
@@ -769,7 +769,7 @@
 set_copy(struct lyxp_set *set)
 {
     struct lyxp_set *ret;
-    uint16_t i;
+    uint32_t i;
 
     if (!set) {
         return NULL;
@@ -997,8 +997,8 @@
 static void
 set_remove_nodes_none(struct lyxp_set *set)
 {
-    uint16_t i, orig_used, end = 0;
-    int32_t start;
+    uint32_t i, orig_used, end = 0;
+    int64_t start;
 
     assert(set);
 
@@ -3755,7 +3755,7 @@
 static LY_ERR
 xpath_derived_(struct lyxp_set **args, struct lyxp_set *set, uint32_t options, ly_bool self_match, const char *func)
 {
-    uint16_t i;
+    uint32_t i;
     LY_ARRAY_COUNT_TYPE u;
     struct lyd_node_term *leaf;
     struct lysc_node_leaf *sleaf;
@@ -5014,7 +5014,7 @@
 {
     long double num;
     char *str;
-    uint16_t i;
+    uint32_t i;
     struct lyxp_set set_item;
     struct lysc_node_leaf *sleaf;
     LY_ERR rc = LY_SUCCESS;
@@ -6709,8 +6709,8 @@
 eval_predicate(const struct lyxp_expr *exp, uint16_t *tok_idx, struct lyxp_set *set, uint32_t options, ly_bool parent_pos_pred)
 {
     LY_ERR rc;
-    uint16_t i, orig_exp;
-    uint32_t orig_pos, orig_size;
+    uint16_t orig_exp;
+    uint32_t i, orig_pos, orig_size;
     int32_t pred_in_ctx;
     struct lyxp_set set2;
     struct lyd_node *orig_parent;