Skip to content

Commit

Permalink
Change const arrays to constexpr
Browse files Browse the repository at this point in the history
so that they can be used with Q_STATIC_ASSERT().
Also constify more another array.

Change-Id: I1e7208127e06abb33af9bdc46712657af5dc98fe
Reviewed-by: Edward Welbourne <[email protected]>
  • Loading branch information
jimis committed May 28, 2020
1 parent fa81b3e commit 52f218e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions util/corelib/qurl-generateTLDs/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ int main(int argc, char **argv)
outFile.write("// After the tldCount \"real\" entries in tldIndices, include a final entry\n");
outFile.write("// that records the sum of the lengths of all the chunks, i.e. the index\n");
outFile.write("// just past the end of tldChunks.\n");
outFile.write("static const quint32 tldIndices[tldCount + 1] = {\n");
outDataBuffer.write("static const char *tldData[tldChunkCount] = {");
outFile.write("static constexpr quint32 tldIndices[tldCount + 1] = {\n");
outDataBuffer.write("static const char * const tldData[tldChunkCount] = {");

int totalUtf8Size = 0;
int chunkSize = 0; // strlen of the current chunk (sizeof is bigger by 1)
Expand Down Expand Up @@ -197,7 +197,7 @@ int main(int argc, char **argv)
// Write tldData[tldChunkCount] = {...}.
outFile.write(outDataBufferBA);

outFile.write("static const quint32 tldChunks[tldChunkCount] = {");
outFile.write("static constexpr quint32 tldChunks[tldChunkCount] = {");
outFile.write(chunks.join(", ").toLatin1());
outFile.write("};\n");
outFile.close();
Expand Down

0 comments on commit 52f218e

Please sign in to comment.