[sr-dev] git:master:ded4fa4f: core: use static map for header name and type for parsing
Henning Westerholt
hw at skalatan.de
Thu Jul 16 15:32:57 CEST 2020
Hello,
git master gives now this warning (gcc 9.3 ubuntu):
CC (gcc) [kamailio] core/parser/parse_hname2.o
core/parser/parse_hname2.c: In function 'ksr_hname_init_index':
core/parser/parse_hname2.c:160:22: warning: array subscript has type 'char' [-Wchar-subscripts]
160 | if(_ksr_hdr_map_idx[c].idxs == -1) {
| ^
core/parser/parse_hname2.c:171:45: warning: array subscript has type 'char' [-Wchar-subscripts]
171 | _ksr_hname_chars_idx[_ksr_hname_chars_list[i]] = 1;
| ~~~~~~~~~~~~~~~~~~~~~^~~
core/parser/parse_hname2.c: In function 'parse_sip_header_name':
core/parser/parse_hname2.c:198:26: warning: array subscript has type 'char' [-Wchar-subscripts]
198 | if(_ksr_hname_chars_idx[*begin] == 0) {
| ^~~~~~
core/parser/parse_hname2.c:208:27: warning: array subscript has type 'char' [-Wchar-subscripts]
208 | if(_ksr_hname_chars_idx[*p] == 0) {
| ^~
core/parser/parse_hname2.c:246:33: warning: array subscript has type 'char' [-Wchar-subscripts]
246 | if(_ksr_hdr_map_idx[hdr->name.s[0]].idxs >= 0) {
| ~~~~~~~~~~~^~~
core/parser/parse_hname2.c:247:39: warning: array subscript has type 'char' [-Wchar-subscripts]
247 | for(i = _ksr_hdr_map_idx[hdr->name.s[0]].idxs;
| ~~~~~~~~~~~^~~
core/parser/parse_hname2.c:248:39: warning: array subscript has type 'char' [-Wchar-subscripts]
248 | i <= _ksr_hdr_map_idx[hdr->name.s[0]].idxe; i++) {
| ~~~~~~~~~~~^~~
-----Original Message-----
From: sr-dev <sr-dev-bounces at lists.kamailio.org> On Behalf Of Daniel-Constantin Mierla
Sent: Thursday, July 16, 2020 2:01 PM
To: sr-dev at lists.kamailio.org
Subject: [sr-dev] git:master:ded4fa4f: core: use static map for header name and type for parsing
Module: kamailio
Branch: master
Commit: ded4fa4ff22f10fd3ad996741190cc5aa2fbcaff
URL: https://github.com/kamailio/kamailio/commit/ded4fa4ff22f10fd3ad996741190cc5aa2fbcaff
Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2020-07-16T13:27:00+02:00
core: use static map for header name and type for parsing
- simplified header name parsing by using indexed (at startup) mapping of header name and type in a static array
---
Modified: src/core/parser/hf.h
Modified: src/core/parser/parse_hname2.c
Modified: src/core/parser/parse_hname2.h
Modified: src/main.c
---
Diff: https://github.com/kamailio/kamailio/commit/ded4fa4ff22f10fd3ad996741190cc5aa2fbcaff.diff
Patch: https://github.com/kamailio/kamailio/commit/ded4fa4ff22f10fd3ad996741190cc5aa2fbcaff.patch
_______________________________________________
Kamailio (SER) - Development Mailing List sr-dev at lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
More information about the sr-dev
mailing list