From cb167ca4cadba02237360fda7510d1477f0f013c Mon Sep 17 00:00:00 2001 From: jacob1 Date: Sun, 8 Sep 2019 22:18:02 -0400 Subject: [PATCH] Fix compilation on gcc 5 and below Can't figure out what the real problem is, the constructor "String(ByteString::value_type const (&ch)[N])" is not being found. Also something in RequestMonitor.h I didn't look into Pushing to a branch because I'd rather fix it properly. This branch will only be used for when I need to compile with gcc 4 --- src/client/http/Request.cpp | 160 +++++++++++++++--------------- src/client/http/RequestMonitor.h | 2 +- src/gui/game/GameController.cpp | 4 +- src/simulation/Simulation.cpp | 2 +- src/simulation/SimulationData.cpp | 48 ++++----- 5 files changed, 108 insertions(+), 108 deletions(-) diff --git a/src/client/http/Request.cpp b/src/client/http/Request.cpp index ab0bf191a2..5d1dcdbe6b 100644 --- a/src/client/http/Request.cpp +++ b/src/client/http/Request.cpp @@ -337,86 +337,86 @@ namespace http { switch (ret) { - case 0: return "Status code 0 (bug?)"; - case 100: return "Continue"; - case 101: return "Switching Protocols"; - case 102: return "Processing"; - case 200: return "OK"; - case 201: return "Created"; - case 202: return "Accepted"; - case 203: return "Non-Authoritative Information"; - case 204: return "No Content"; - case 205: return "Reset Content"; - case 206: return "Partial Content"; - case 207: return "Multi-Status"; - case 300: return "Multiple Choices"; - case 301: return "Moved Permanently"; - case 302: return "Found"; - case 303: return "See Other"; - case 304: return "Not Modified"; - case 305: return "Use Proxy"; - case 306: return "Switch Proxy"; - case 307: return "Temporary Redirect"; - case 400: return "Bad Request"; - case 401: return "Unauthorized"; - case 402: return "Payment Required"; - case 403: return "Forbidden"; - case 404: return "Not Found"; - case 405: return "Method Not Allowed"; - case 406: return "Not Acceptable"; - case 407: return "Proxy Authentication Required"; - case 408: return "Request Timeout"; - case 409: return "Conflict"; - case 410: return "Gone"; - case 411: return "Length Required"; - case 412: return "Precondition Failed"; - case 413: return "Request Entity Too Large"; - case 414: return "Request URI Too Long"; - case 415: return "Unsupported Media Type"; - case 416: return "Requested Range Not Satisfiable"; - case 417: return "Expectation Failed"; - case 418: return "I'm a teapot"; - case 422: return "Unprocessable Entity"; - case 423: return "Locked"; - case 424: return "Failed Dependency"; - case 425: return "Unordered Collection"; - case 426: return "Upgrade Required"; - case 444: return "No Response"; - case 450: return "Blocked by Windows Parental Controls"; - case 499: return "Client Closed Request"; - case 500: return "Internal Server Error"; - case 501: return "Not Implemented"; - case 502: return "Bad Gateway"; - case 503: return "Service Unavailable"; - case 504: return "Gateway Timeout"; - case 505: return "HTTP Version Not Supported"; - case 506: return "Variant Also Negotiates"; - case 507: return "Insufficient Storage"; - case 509: return "Bandwidth Limit Exceeded"; - case 510: return "Not Extended"; - case 600: return "Internal Client Error"; - case 601: return "Unsupported Protocol"; - case 602: return "Server Not Found"; - case 603: return "Malformed Response"; - case 604: return "Network Not Available"; - case 605: return "Request Timed Out"; - case 606: return "Malformed URL"; - case 607: return "Connection Refused"; - case 608: return "Proxy Server Not Found"; - case 609: return "SSL: Invalid Certificate Status"; - case 610: return "Cancelled by Shutdown"; - case 611: return "Too Many Redirects"; - case 612: return "SSL: Connect Error"; - case 613: return "SSL: Crypto Engine Not Found"; - case 614: return "SSL: Failed to Set Default Crypto Engine"; - case 615: return "SSL: Local Certificate Issue"; - case 616: return "SSL: Unable to Use Specified Cipher"; - case 617: return "SSL: Failed to Initialise Crypto Engine"; - case 618: return "SSL: Failed to Load CACERT File"; - case 619: return "SSL: Failed to Load CRL File"; - case 620: return "SSL: Issuer Check Failed"; - case 621: return "SSL: Pinned Public Key Mismatch"; - default: return "Unknown Status Code"; + case 0: return String("Status code 0 (bug?)"); + case 100: return String("Continue"); + case 101: return String("Switching Protocols"); + case 102: return String("Processing"); + case 200: return String("OK"); + case 201: return String("Created"); + case 202: return String("Accepted"); + case 203: return String("Non-Authoritative Information"); + case 204: return String("No Content"); + case 205: return String("Reset Content"); + case 206: return String("Partial Content"); + case 207: return String("Multi-Status"); + case 300: return String("Multiple Choices"); + case 301: return String("Moved Permanently"); + case 302: return String("Found"); + case 303: return String("See Other"); + case 304: return String("Not Modified"); + case 305: return String("Use Proxy"); + case 306: return String("Switch Proxy"); + case 307: return String("Temporary Redirect"); + case 400: return String("Bad Request"); + case 401: return String("Unauthorized"); + case 402: return String("Payment Required"); + case 403: return String("Forbidden"); + case 404: return String("Not Found"); + case 405: return String("Method Not Allowed"); + case 406: return String("Not Acceptable"); + case 407: return String("Proxy Authentication Required"); + case 408: return String("Request Timeout"); + case 409: return String("Conflict"); + case 410: return String("Gone"); + case 411: return String("Length Required"); + case 412: return String("Precondition Failed"); + case 413: return String("Request Entity Too Large"); + case 414: return String("Request URI Too Long"); + case 415: return String("Unsupported Media Type"); + case 416: return String("Requested Range Not Satisfiable"); + case 417: return String("Expectation Failed"); + case 418: return String("I'm a teapot"); + case 422: return String("Unprocessable Entity"); + case 423: return String("Locked"); + case 424: return String("Failed Dependency"); + case 425: return String("Unordered Collection"); + case 426: return String("Upgrade Required"); + case 444: return String("No Response"); + case 450: return String("Blocked by Windows Parental Controls"); + case 499: return String("Client Closed Request"); + case 500: return String("Internal Server Error"); + case 501: return String("Not Implemented"); + case 502: return String("Bad Gateway"); + case 503: return String("Service Unavailable"); + case 504: return String("Gateway Timeout"); + case 505: return String("HTTP Version Not Supported"); + case 506: return String("Variant Also Negotiates"); + case 507: return String("Insufficient Storage"); + case 509: return String("Bandwidth Limit Exceeded"); + case 510: return String("Not Extended"); + case 600: return String("Internal Client Error"); + case 601: return String("Unsupported Protocol"); + case 602: return String("Server Not Found"); + case 603: return String("Malformed Response"); + case 604: return String("Network Not Available"); + case 605: return String("Request Timed Out"); + case 606: return String("Malformed URL"); + case 607: return String("Connection Refused"); + case 608: return String("Proxy Server Not Found"); + case 609: return String("SSL: Invalid Certificate Status"); + case 610: return String("Cancelled by Shutdown"); + case 611: return String("Too Many Redirects"); + case 612: return String("SSL: Connect Error"); + case 613: return String("SSL: Crypto Engine Not Found"); + case 614: return String("SSL: Failed to Set Default Crypto Engine"); + case 615: return String("SSL: Local Certificate Issue"); + case 616: return String("SSL: Unable to Use Specified Cipher"); + case 617: return String("SSL: Failed to Initialise Crypto Engine"); + case 618: return String("SSL: Failed to Load CACERT File"); + case 619: return String("SSL: Failed to Load CRL File"); + case 620: return String("SSL: Issuer Check Failed"); + case 621: return String("SSL: Pinned Public Key Mismatch"); + default: return String("Unknown Status Code"); } } } diff --git a/src/client/http/RequestMonitor.h b/src/client/http/RequestMonitor.h index d32886c894..39f04852f2 100644 --- a/src/client/http/RequestMonitor.h +++ b/src/client/http/RequestMonitor.h @@ -11,7 +11,7 @@ namespace http { R *request; - protected: + public: RequestMonitor() : request(nullptr) { diff --git a/src/gui/game/GameController.cpp b/src/gui/game/GameController.cpp index 90efc73712..ca9b0f771d 100644 --- a/src/gui/game/GameController.cpp +++ b/src/gui/game/GameController.cpp @@ -1598,7 +1598,7 @@ String GameController::ElementResolve(int type, int ctype) { return gameModel->GetSimulation()->ElementResolve(type, ctype); } - return ""; + return String(""); } String GameController::BasicParticleInfo(Particle const &sample_part) @@ -1607,7 +1607,7 @@ String GameController::BasicParticleInfo(Particle const &sample_part) { return gameModel->GetSimulation()->BasicParticleInfo(sample_part); } - return ""; + return String(""); } void GameController::ReloadSim() diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp index fab9f1c5e0..547a568f84 100644 --- a/src/simulation/Simulation.cpp +++ b/src/simulation/Simulation.cpp @@ -5497,7 +5497,7 @@ String Simulation::ElementResolve(int type, int ctype) { return elements[type].Name; } - return "Empty"; + return String("Empty"); } String Simulation::BasicParticleInfo(Particle const &sample_part) diff --git a/src/simulation/SimulationData.cpp b/src/simulation/SimulationData.cpp index 8fc7b099ec..813553c4c0 100644 --- a/src/simulation/SimulationData.cpp +++ b/src/simulation/SimulationData.cpp @@ -14,30 +14,30 @@ std::vector LoadGOLMenu() { return std::vector{ - {"GOL", PIXPACK(0x0CAC00), 0, String("Game Of Life: Begin 3/Stay 23")}, - {"HLIF", PIXPACK(0xFF0000), 1, String("High Life: B36/S23")}, - {"ASIM", PIXPACK(0x0000FF), 2, String("Assimilation: B345/S4567")}, - {"2x2", PIXPACK(0xFFFF00), 3, String("2x2: B36/S125")}, - {"DANI", PIXPACK(0x00FFFF), 4, String("Day and Night: B3678/S34678")}, - {"AMOE", PIXPACK(0xFF00FF), 5, String("Amoeba: B357/S1358")}, - {"MOVE", PIXPACK(0xFFFFFF), 6, String("'Move' particles. Does not move things.. it is a life type: B368/S245")}, - {"PGOL", PIXPACK(0xE05010), 7, String("Pseudo Life: B357/S238")}, - {"DMOE", PIXPACK(0x500000), 8, String("Diamoeba: B35678/S5678")}, - {"34", PIXPACK(0x500050), 9, String("34: B34/S34")}, - {"LLIF", PIXPACK(0x505050), 10, String("Long Life: B345/S5")}, - {"STAN", PIXPACK(0x5000FF), 11, String("Stains: B3678/S235678")}, - {"SEED", PIXPACK(0xFBEC7D), 12, String("Seeds: B2/S")}, - {"MAZE", PIXPACK(0xA8E4A0), 13, String("Maze: B3/S12345")}, - {"COAG", PIXPACK(0x9ACD32), 14, String("Coagulations: B378/S235678")}, - {"WALL", PIXPACK(0x0047AB), 15, String("Walled cities: B45678/S2345")}, - {"GNAR", PIXPACK(0xE5B73B), 16, String("Gnarl: B1/S1")}, - {"REPL", PIXPACK(0x259588), 17, String("Replicator: B1357/S1357")}, - {"MYST", PIXPACK(0x0C3C00), 18, String("Mystery: B3458/S05678")}, - {"LOTE", PIXPACK(0xFF0000), 19, String("Living on the Edge: B37/S3458/4")}, - {"FRG2", PIXPACK(0x00FF00), 20, String("Like Frogs rule: B3/S124/3")}, - {"STAR", PIXPACK(0x0000FF), 21, String("Like Star Wars rule: B278/S3456/6")}, - {"FROG", PIXPACK(0x00AA00), 22, String("Frogs: B34/S12/3")}, - {"BRAN", PIXPACK(0xCCCC00), 23, String("Brian 6: B246/S6/3")} + {String("GOL"), PIXPACK(0x0CAC00), 0, String("Game Of Life: Begin 3/Stay 23")}, + {String("HLIF"), PIXPACK(0xFF0000), 1, String("High Life: B36/S23")}, + {String("ASIM"), PIXPACK(0x0000FF), 2, String("Assimilation: B345/S4567")}, + {String("2x2"), PIXPACK(0xFFFF00), 3, String("2x2: B36/S125")}, + {String("DANI"), PIXPACK(0x00FFFF), 4, String("Day and Night: B3678/S34678")}, + {String("AMOE"), PIXPACK(0xFF00FF), 5, String("Amoeba: B357/S1358")}, + {String("MOVE"), PIXPACK(0xFFFFFF), 6, String("'Move' particles. Does not move things.. it is a life type: B368/S245")}, + {String("PGOL"), PIXPACK(0xE05010), 7, String("Pseudo Life: B357/S238")}, + {String("DMOE"), PIXPACK(0x500000), 8, String("Diamoeba: B35678/S5678")}, + {String("34"), PIXPACK(0x500050), 9, String("34: B34/S34")}, + {String("LLIF"), PIXPACK(0x505050), 10, String("Long Life: B345/S5")}, + {String("STAN"), PIXPACK(0x5000FF), 11, String("Stains: B3678/S235678")}, + {String("SEED"), PIXPACK(0xFBEC7D), 12, String("Seeds: B2/S")}, + {String("MAZE"), PIXPACK(0xA8E4A0), 13, String("Maze: B3/S12345")}, + {String("COAG"), PIXPACK(0x9ACD32), 14, String("Coagulations: B378/S235678")}, + {String("WALL"), PIXPACK(0x0047AB), 15, String("Walled cities: B45678/S2345")}, + {String("GNAR"), PIXPACK(0xE5B73B), 16, String("Gnarl: B1/S1")}, + {String("REPL"), PIXPACK(0x259588), 17, String("Replicator: B1357/S1357")}, + {String("MYST"), PIXPACK(0x0C3C00), 18, String("Mystery: B3458/S05678")}, + {String("LOTE"), PIXPACK(0xFF0000), 19, String("Living on the Edge: B37/S3458/4")}, + {String("FRG2"), PIXPACK(0x00FF00), 20, String("Like Frogs rule: B3/S124/3")}, + {String("STAR"), PIXPACK(0x0000FF), 21, String("Like Star Wars rule: B278/S3456/6")}, + {String("FROG"), PIXPACK(0x00AA00), 22, String("Frogs: B34/S12/3")}, + {String("BRAN"), PIXPACK(0xCCCC00), 23, String("Brian 6: B246/S6/3")} }; }