From 27dc53b451c047c81b87eea055cdba5a2986658e Mon Sep 17 00:00:00 2001 From: Jan Date: Wed, 5 Jul 2017 19:34:16 +0200 Subject: [PATCH] Bug fix/cleanup stuff (#2734) * cppcheck * remove unused files * cppcheck just sucks * add _FORTIFY_SOURCE --- CMakeLists.txt | 4 +- arangod/MMFiles/mmfiles-replication-dump.h | 2 +- arangod/Utils/ExecContext.h | 4 +- .../test-data/random500/generated_edges.csv | 511 ------------------ .../random500/generated_testcases.csv | 87 --- .../random500/generated_vertices.csv | 501 ----------------- .../test-data/random500/neo4j-dijkstra.csv | 132 ----- lib/Rest/VstRequest.h | 2 - 8 files changed, 5 insertions(+), 1238 deletions(-) delete mode 100644 js/common/test-data/random500/generated_edges.csv delete mode 100644 js/common/test-data/random500/generated_testcases.csv delete mode 100644 js/common/test-data/random500/generated_vertices.csv delete mode 100644 js/common/test-data/random500/neo4j-dijkstra.csv diff --git a/CMakeLists.txt b/CMakeLists.txt index 24ed2f58f1..81b61f0378 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -461,7 +461,6 @@ else () set(BASE_FLAGS "${Vc_COMPILE_FLAGS} ${BASE_FLAGS}") endif () - ################################################################################ ## BACKTRACE ################################################################################ @@ -514,6 +513,9 @@ option(USE_MAINTAINER_MODE if (USE_MAINTAINER_MODE) add_definitions("-DARANGODB_ENABLE_MAINTAINER_MODE=1") + if (CMAKE_COMPILER_IS_GNUCC) + add_definitions("-D_FORTIFY_SOURCE=2") + endif() find_package(FLEX) find_package(BISON) diff --git a/arangod/MMFiles/mmfiles-replication-dump.h b/arangod/MMFiles/mmfiles-replication-dump.h index 700f59a018..0b6b190895 100644 --- a/arangod/MMFiles/mmfiles-replication-dump.h +++ b/arangod/MMFiles/mmfiles-replication-dump.h @@ -42,7 +42,7 @@ /// @brief replication dump container struct MMFilesReplicationDumpContext { - MMFilesReplicationDumpContext(std::shared_ptr + MMFilesReplicationDumpContext(std::shared_ptr const& transactionContext, size_t chunkSize, bool includeSystem, TRI_voc_cid_t restrictCollection, bool useVst = false) diff --git a/arangod/Utils/ExecContext.h b/arangod/Utils/ExecContext.h index 6e35419850..bcb674e655 100644 --- a/arangod/Utils/ExecContext.h +++ b/arangod/Utils/ExecContext.h @@ -52,9 +52,7 @@ class ExecContext { public: ExecContext(std::string const& user, std::string const& database, std::shared_ptr authContext) - : _user(user), _database(database) { - _auth = authContext; - } + : _user(user), _database(database), _auth(authContext) {} static thread_local ExecContext* CURRENT_EXECCONTEXT; diff --git a/js/common/test-data/random500/generated_edges.csv b/js/common/test-data/random500/generated_edges.csv deleted file mode 100644 index dfa3a8ba6b..0000000000 --- a/js/common/test-data/random500/generated_edges.csv +++ /dev/null @@ -1,511 +0,0 @@ -edge_id,from_id,to_id -0,9,4 -1,11,5 -2,2,10 -3,12,1 -4,14,6 -5,16,2 -6,3,10 -7,0,4 -8,17,3 -9,19,3 -10,8,6 -11,18,3 -12,13,19 -13,15,2 -14,7,15 -15,21,3 -16,21,8 -17,22,4 -18,23,1 -19,24,14 -20,24,15 -21,25,3 -22,25,5 -23,25,8 -24,25,9 -25,27,0 -26,28,3 -27,29,8 -28,29,27 -29,32,5 -30,32,9 -31,33,2 -32,33,6 -33,34,10 -34,34,14 -35,35,25 -36,38,2 -37,40,3 -38,41,10 -39,42,0 -40,43,16 -41,43,29 -42,44,3 -43,44,29 -44,48,5 -45,50,32 -46,50,43 -47,51,4 -48,52,50 -49,54,25 -50,54,35 -51,54,38 -52,54,44 -53,56,15 -54,57,8 -55,57,56 -56,60,3 -57,63,3 -58,63,9 -59,63,14 -60,64,2 -61,65,3 -62,65,9 -63,65,10 -64,65,21 -65,67,5 -66,69,43 -67,69,50 -68,69,56 -69,70,35 -70,72,50 -71,74,3 -72,74,57 -73,77,14 -74,77,23 -75,77,69 -76,77,70 -77,78,10 -78,78,34 -79,81,3 -80,83,77 -81,84,3 -82,85,23 -83,85,78 -84,86,41 -85,88,3 -86,89,21 -87,90,2 -88,90,12 -89,92,50 -90,93,0 -91,93,25 -92,94,16 -93,97,65 -94,98,9 -95,99,25 -96,100,2 -97,102,25 -98,102,52 -99,102,69 -100,104,3 -101,105,25 -102,105,102 -103,106,3 -104,107,4 -105,107,25 -106,107,44 -107,107,84 -108,107,90 -109,108,107 -110,111,3 -111,113,34 -112,114,6 -113,114,74 -114,115,69 -115,116,70 -116,117,50 -117,118,3 -118,118,14 -119,118,107 -120,119,107 -121,122,10 -122,123,15 -123,124,29 -124,125,25 -125,125,32 -126,125,117 -127,126,115 -128,129,78 -129,131,0 -130,132,41 -131,133,22 -132,136,78 -133,137,2 -134,138,65 -135,140,6 -136,140,63 -137,141,3 -138,141,25 -139,142,41 -140,142,52 -141,143,6 -142,146,74 -143,146,77 -144,148,3 -145,148,9 -146,148,50 -147,150,77 -148,151,77 -149,152,3 -150,153,3 -151,153,57 -152,153,77 -153,154,50 -154,155,3 -155,156,3 -156,156,51 -157,157,43 -158,157,57 -159,157,84 -160,158,2 -161,158,35 -162,158,48 -163,162,3 -164,164,32 -165,164,90 -166,167,13 -167,170,44 -168,172,52 -169,172,86 -170,174,2 -171,174,25 -172,175,3 -173,176,54 -174,177,63 -175,178,22 -176,179,35 -177,181,155 -178,182,52 -179,182,157 -180,183,3 -181,184,78 -182,184,84 -183,185,111 -184,187,43 -185,189,182 -186,190,3 -187,190,63 -188,192,3 -189,192,33 -190,193,190 -191,194,102 -192,195,38 -193,195,69 -194,195,148 -195,197,15 -196,197,69 -197,198,9 -198,198,44 -199,198,69 -200,199,24 -201,200,38 -202,200,181 -203,201,107 -204,203,77 -205,204,63 -206,205,32 -207,205,56 -208,206,70 -209,206,78 -210,208,3 -211,209,65 -212,212,15 -213,213,197 -214,214,25 -215,219,35 -216,219,115 -217,222,70 -218,222,164 -219,226,206 -220,227,21 -221,227,85 -222,229,63 -223,230,63 -224,232,142 -225,233,15 -226,233,200 -227,234,60 -228,234,69 -229,234,183 -230,236,5 -231,238,9 -232,240,182 -233,241,10 -234,241,52 -235,242,57 -236,243,3 -237,245,2 -238,245,22 -239,247,118 -240,248,3 -241,249,4 -242,249,50 -243,250,152 -244,250,222 -245,251,182 -246,253,41 -247,254,25 -248,256,3 -249,256,140 -250,257,8 -251,257,50 -252,257,107 -253,258,162 -254,259,6 -255,261,65 -256,261,162 -257,262,13 -258,262,24 -259,262,83 -260,262,86 -261,262,204 -262,263,213 -263,264,131 -264,265,78 -265,265,102 -266,265,122 -267,267,9 -268,267,158 -269,267,200 -270,267,233 -271,268,107 -272,269,167 -273,270,56 -274,270,102 -275,275,233 -276,276,15 -277,277,5 -278,277,83 -279,278,4 -280,278,9 -281,278,155 -282,279,3 -283,280,3 -284,280,33 -285,281,63 -286,281,204 -287,282,97 -288,283,5 -289,283,131 -290,283,197 -291,284,22 -292,285,4 -293,286,14 -294,286,155 -295,287,200 -296,287,209 -297,288,3 -298,288,240 -299,289,40 -300,290,29 -301,290,143 -302,290,283 -303,291,56 -304,292,54 -305,292,280 -306,293,5 -307,293,175 -308,295,114 -309,296,52 -310,297,0 -311,297,14 -312,297,83 -313,298,102 -314,298,205 -315,299,65 -316,299,138 -317,303,77 -318,304,3 -319,304,140 -320,304,146 -321,305,56 -322,306,63 -323,307,3 -324,310,90 -325,313,10 -326,317,8 -327,317,14 -328,317,142 -329,319,153 -330,320,197 -331,322,16 -332,324,57 -333,324,172 -334,325,69 -335,326,206 -336,327,50 -337,327,63 -338,328,57 -339,330,74 -340,332,102 -341,333,277 -342,334,22 -343,334,44 -344,335,25 -345,336,288 -346,336,330 -347,337,3 -348,337,162 -349,338,52 -350,338,146 -351,339,118 -352,340,69 -353,341,233 -354,344,162 -355,344,267 -356,346,0 -357,346,2 -358,347,6 -359,347,336 -360,349,35 -361,350,77 -362,351,78 -363,353,15 -364,354,195 -365,356,10 -366,358,182 -367,359,305 -368,360,35 -369,361,99 -370,362,65 -371,363,56 -372,364,19 -373,364,107 -374,364,122 -375,365,34 -376,365,63 -377,366,32 -378,367,22 -379,368,86 -380,370,22 -381,371,313 -382,372,32 -383,372,63 -384,375,77 -385,375,295 -386,377,25 -387,378,69 -388,378,140 -389,379,227 -390,379,233 -391,380,3 -392,380,56 -393,380,287 -394,381,25 -395,382,56 -396,383,9 -397,385,19 -398,386,78 -399,387,22 -400,388,22 -401,390,198 -402,391,43 -403,395,2 -404,396,200 -405,398,9 -406,400,78 -407,400,107 -408,401,262 -409,402,9 -410,402,63 -411,402,185 -412,404,25 -413,404,99 -414,404,250 -415,405,371 -416,406,22 -417,407,9 -418,407,245 -419,409,213 -420,410,2 -421,410,44 -422,411,363 -423,412,32 -424,413,3 -425,413,33 -426,414,77 -427,415,341 -428,416,152 -429,419,288 -430,420,10 -431,420,155 -432,420,299 -433,421,38 -434,421,92 -435,421,390 -436,422,88 -437,425,197 -438,425,248 -439,427,44 -440,429,54 -441,429,251 -442,430,51 -443,430,203 -444,433,56 -445,434,24 -446,434,164 -447,438,122 -448,438,359 -449,439,233 -450,440,304 -451,441,25 -452,442,4 -453,444,182 -454,445,108 -455,447,3 -456,449,99 -457,450,364 -458,451,267 -459,452,269 -460,453,264 -461,455,52 -462,455,93 -463,455,277 -464,456,219 -465,457,258 -466,458,52 -467,459,9 -468,459,205 -469,460,14 -470,460,86 -471,461,170 -472,461,368 -473,462,92 -474,462,209 -475,465,371 -476,465,430 -477,466,233 -478,467,3 -479,467,25 -480,469,378 -481,470,167 -482,472,102 -483,472,288 -484,475,212 -485,475,434 -486,477,287 -487,479,19 -488,479,152 -489,481,57 -490,481,83 -491,481,289 -492,481,305 -493,481,434 -494,482,83 -495,484,18 -496,484,174 -497,484,182 -498,487,43 -499,487,99 -500,488,56 -501,488,78 -502,489,450 -503,492,14 -504,492,102 -505,494,52 -506,495,125 -507,495,230 -508,498,88 -509,498,269 diff --git a/js/common/test-data/random500/generated_testcases.csv b/js/common/test-data/random500/generated_testcases.csv deleted file mode 100644 index 7c1cf738b4..0000000000 --- a/js/common/test-data/random500/generated_testcases.csv +++ /dev/null @@ -1,87 +0,0 @@ -from_id,to_id -0,340 -0,25 -0,129 -1,4 -1,396 -1,270 -1,50 -1,382 -2,184 -2,463 -2,364 -2,468 -2,234 -3,21 -3,458 -3,47 -3,89 -3,448 -3,130 -3,456 -3,485 -4,204 -5,118 -5,428 -6,252 -6,105 -6,106 -6,38 -6,352 -6,181 -7,246 -7,407 -7,125 -7,238 -7,412 -7,51 -7,457 -7,274 -7,417 -8,255 -8,119 -8,494 -8,333 -8,476 -8,118 -8,247 -8,418 -9,174 -10,30 -10,352 -10,75 -10,166 -10,166 -11,388 -11,297 -11,239 -12,372 -12,489 -12,81 -12,47 -12,490 -13,75 -14,51 -15,398 -15,34 -15,154 -15,28 -16,415 -16,240 -16,385 -17,37 -17,472 -17,477 -18,307 -18,313 -18,121 -18,259 -18,471 -18,67 -18,395 -19,319 -19,35 -19,70 -19,303 -19,474 -19,76 diff --git a/js/common/test-data/random500/generated_vertices.csv b/js/common/test-data/random500/generated_vertices.csv deleted file mode 100644 index fa2313a867..0000000000 --- a/js/common/test-data/random500/generated_vertices.csv +++ /dev/null @@ -1,501 +0,0 @@ -vertex_id -0 -1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295 -296 -297 -298 -299 -300 -301 -302 -303 -304 -305 -306 -307 -308 -309 -310 -311 -312 -313 -314 -315 -316 -317 -318 -319 -320 -321 -322 -323 -324 -325 -326 -327 -328 -329 -330 -331 -332 -333 -334 -335 -336 -337 -338 -339 -340 -341 -342 -343 -344 -345 -346 -347 -348 -349 -350 -351 -352 -353 -354 -355 -356 -357 -358 -359 -360 -361 -362 -363 -364 -365 -366 -367 -368 -369 -370 -371 -372 -373 -374 -375 -376 -377 -378 -379 -380 -381 -382 -383 -384 -385 -386 -387 -388 -389 -390 -391 -392 -393 -394 -395 -396 -397 -398 -399 -400 -401 -402 -403 -404 -405 -406 -407 -408 -409 -410 -411 -412 -413 -414 -415 -416 -417 -418 -419 -420 -421 -422 -423 -424 -425 -426 -427 -428 -429 -430 -431 -432 -433 -434 -435 -436 -437 -438 -439 -440 -441 -442 -443 -444 -445 -446 -447 -448 -449 -450 -451 -452 -453 -454 -455 -456 -457 -458 -459 -460 -461 -462 -463 -464 -465 -466 -467 -468 -469 -470 -471 -472 -473 -474 -475 -476 -477 -478 -479 -480 -481 -482 -483 -484 -485 -486 -487 -488 -489 -490 -491 -492 -493 -494 -495 -496 -497 -498 -499 diff --git a/js/common/test-data/random500/neo4j-dijkstra.csv b/js/common/test-data/random500/neo4j-dijkstra.csv deleted file mode 100644 index 4387cf4af2..0000000000 --- a/js/common/test-data/random500/neo4j-dijkstra.csv +++ /dev/null @@ -1,132 +0,0 @@ -0,27,29,43,69,340 -0,131,283,197,69,340 -0,93,25,102,69,340 -0,4,9,198,69,340 -0,297,14,77,69,340 -0,297,83,77,69,340 -0,4,249,50,69,340 -0,93,25 -0,297,14,34,78,129 -0,346,2,10,78,129 -0,4,107,400,78,129 -1,12,90,107,4 -1,12,90,2,38,200,396 -1,23,77,69,102,270 -1,23,77,69,56,270 -1,23,77,69,50 -1,23,77,69,56,382 -2,10,78,184 -2,10,122,364 -2,90,107,364 -2,10,3,60,234 -2,16,43,69,234 -2,38,195,69,234 -2,15,56,69,234 -2,15,197,69,234 -2,10,3,183,234 -3,21 -3,25,102,52,458 -3,148,50,52,458 -3,10,241,52,458 -3,21,89 -3,25,35,219,456 -4,9,63,204 -5,25,107,118 -5,25,3,118 -6,8,25,105 -6,33,192,3,106 -6,140,63,3,106 -6,14,63,3,106 -6,33,280,3,106 -6,114,74,3,106 -6,8,21,3,106 -6,8,25,3,106 -6,14,118,3,106 -6,33,413,3,106 -6,140,256,3,106 -6,140,304,3,106 -6,33,2,38 -6,14,286,155,181 -7,15,2,245,407 -7,15,2,174,25,125 -7,15,56,205,32,125 -7,15,233,267,9,238 -7,15,56,205,32,412 -7,15,2,10,3,156,51 -7,15,56,380,3,156,51 -7,15,2,346,0,4,51 -7,15,233,267,9,4,51 -7,15,2,245,22,4,51 -7,15,2,90,107,4,51 -7,15,233,267,344,162,258,457 -7,15,56,380,3,162,258,457 -7,15,2,10,3,162,258,457 -8,257,107,119 -8,25,107,119 -8,317,142,52,494 -8,257,50,52,494 -8,25,102,52,494 -8,25,5,277,333 -8,25,3,118 -8,21,3,118 -8,317,14,118 -8,6,14,118 -8,257,107,118 -8,25,107,118 -8,25,107,118,247 -8,257,107,118,247 -8,6,14,118,247 -8,317,14,118,247 -8,21,3,118,247 -8,25,3,118,247 -9,25,174 -11,5,25,9,4,22,388 -11,5,32,9,4,22,388 -11,5,25,107,4,22,388 -11,5,277,83,297 -12,90,164,32,372 -12,90,107,364,450,489 -12,90,107,25,3,81 -12,90,107,44,3,81 -12,90,107,84,3,81 -12,90,107,118,3,81 -12,90,2,10,3,81 -14,118,3,156,51 -14,63,3,156,51 -14,77,203,430,51 -14,118,107,4,51 -14,297,0,4,51 -14,63,9,4,51 -15,233,267,9,398 -15,2,10,34 -15,24,14,34 -15,197,69,50,154 -15,56,69,50,154 -15,56,380,3,28 -15,2,10,3,28 -16,2,15,233,341,415 -16,43,157,182,240 -16,2,10,3,19,385 -17,3,288,472 -17,3,380,287,477 -18,3,307 -18,3,10,313 -18,3,74,114,6,259 -18,3,63,14,6,259 -18,3,118,14,6,259 -18,3,413,33,6,259 -18,3,280,33,6,259 -18,3,192,33,6,259 -18,3,25,8,6,259 -18,3,21,8,6,259 -18,3,63,140,6,259 -18,3,304,140,6,259 -18,3,256,140,6,259 -18,3,25,5,67 -18,484,174,2,395 -18,3,10,2,395 -19,3,153,319 -19,3,25,35 -19,3,153,77,70 -19,3,25,35,70 -19,3,153,77,303 diff --git a/lib/Rest/VstRequest.h b/lib/Rest/VstRequest.h index 192bc53dca..7830de7521 100644 --- a/lib/Rest/VstRequest.h +++ b/lib/Rest/VstRequest.h @@ -42,7 +42,6 @@ class RestBatchHandler; namespace rest { class GeneralCommTask; class VstCommTask; -// class VstsCommTask; } namespace velocypack { @@ -54,7 +53,6 @@ using rest::VstInputMessage; class VstRequest final : public GeneralRequest { friend class rest::VstCommTask; - // friend class rest::VstsCommTask; friend class rest::GeneralCommTask; friend class RestBatchHandler; // TODO must be removed