~haaaad/geany/master

« back to all changes in this revision

Viewing changes to scintilla/lexlib/WordList.cxx

  • Committer: elextr
  • Author(s): Colomban Wendling
  • Date: 2017-07-24 23:24:05 UTC
  • Revision ID: git-v1:18360460abb4f4bec23dff127031ecf4e9120f7f
Update Scintilla to version 3.7.5 (#1503)

* Update Scintilla to version 3.7.5

This now requires a C++11-capable compiler.

Closes #1308.

* Test using newer dist on Travis

Since Scintilla needs C++11

* Add debugging code for when configure fails

* Workaround a pkg-config-corsswrapper bug on Ubuntu 14.04

See https://bugs.launchpad.net/ubuntu/+source/mingw-w64/+bug/1327242

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
// Copyright 1998-2002 by Neil Hodgson <neilh@scintilla.org>
6
6
// The License.txt file describes the conditions under which this software may be distributed.
7
7
 
8
 
#include <stdlib.h>
9
 
#include <string.h>
10
 
#include <stdio.h>
11
 
#include <stdarg.h>
12
 
#include <ctype.h>
 
8
#include <cstdlib>
 
9
#include <cassert>
 
10
#include <cstring>
13
11
 
14
12
#include <algorithm>
15
13
 
37
35
                wordSeparator[static_cast<unsigned int>('\t')] = true;
38
36
        }
39
37
        for (int j = 0; wordlist[j]; j++) {
40
 
                int curr = static_cast<unsigned char>(wordlist[j]);
 
38
                const int curr = static_cast<unsigned char>(wordlist[j]);
41
39
                if (!wordSeparator[curr] && wordSeparator[prev])
42
40
                        words++;
43
41
                prev = curr;
59
57
                        prev = wordlist[k];
60
58
                }
61
59
        }
 
60
        assert(wordsStore < (words + 1));
62
61
        keywords[wordsStore] = &wordlist[slen];
63
62
        *len = wordsStore;
64
63
        return keywords;
146
145
bool WordList::InList(const char *s) const {
147
146
        if (0 == words)
148
147
                return false;
149
 
        unsigned char firstChar = s[0];
 
148
        const unsigned char firstChar = s[0];
150
149
        int j = starts[firstChar];
151
150
        if (j >= 0) {
152
151
                while (static_cast<unsigned char>(words[j][0]) == firstChar) {
188
187
bool WordList::InListAbbreviated(const char *s, const char marker) const {
189
188
        if (0 == words)
190
189
                return false;
191
 
        unsigned char firstChar = s[0];
 
190
        const unsigned char firstChar = s[0];
192
191
        int j = starts[firstChar];
193
192
        if (j >= 0) {
194
193
                while (static_cast<unsigned char>(words[j][0]) == firstChar) {
242
241
bool WordList::InListAbridged(const char *s, const char marker) const {
243
242
        if (0 == words)
244
243
                return false;
245
 
        unsigned char firstChar = s[0];
 
244
        const unsigned char firstChar = s[0];
246
245
        int j = starts[firstChar];
247
246
        if (j >= 0) {
248
247
                while (static_cast<unsigned char>(words[j][0]) == firstChar) {