| Date: | 2010-07-28 03:31:41 (13 years 4 months ago) |
|---|---|
| Author: | Maarten ter Huurne |
| Commit: | 4ddc18984774ae448dd2f8d808eb2fd2633d3344 |
| Message: | Use tr1::unordered_map instead of google::dense_hash_map in class
GMenu2X. This reduces the binary size by about 260K. |
| Files: |
src/gmenu2x.cpp (2 diffs) src/gmenu2x.h (3 diffs) src/menusettingmultistring.cpp (1 diff) |
Change Details
| src/gmenu2x.cpp | ||
|---|---|---|
| 21 | 21 | #include <iostream> |
| 22 | 22 | #include <sstream> |
| 23 | 23 | #include <fstream> |
| 24 | #include <algorithm> | |
| 24 | 25 | #include <stdlib.h> |
| 25 | 26 | #include <unistd.h> |
| 26 | 27 | #include <math.h> |
| ... | ... | |
| 170 | 171 | f200 = true; |
| 171 | 172 | #endif |
| 172 | 173 | |
| 173 | confStr.set_empty_key(" "); | |
| 174 | confStr.set_deleted_key(""); | |
| 175 | confInt.set_empty_key(" "); | |
| 176 | confInt.set_deleted_key(""); | |
| 177 | skinConfInt.set_empty_key(" "); | |
| 178 | skinConfInt.set_deleted_key(""); | |
| 179 | skinConfStr.set_empty_key(" "); | |
| 180 | skinConfStr.set_deleted_key(""); | |
| 181 | ||
| 182 | 174 | //open2x |
| 183 | 175 | savedVolumeMode = 0; |
| 184 | 176 | volumeMode = VOLUME_MODE_NORMAL; |
| src/gmenu2x.h | ||
|---|---|---|
| 21 | 21 | #ifndef GMENU2X_H |
| 22 | 22 | #define GMENU2X_H |
| 23 | 23 | |
| 24 | #include <string> | |
| 25 | #include <iostream> | |
| 26 | ||
| 27 | #include "google/dense_hash_map" | |
| 28 | 24 | #include "surfacecollection.h" |
| 29 | 25 | #include "iconbutton.h" |
| 30 | 26 | #include "translator.h" |
| ... | ... | |
| 35 | 31 | #include "asfont.h" |
| 36 | 32 | #include "surface.h" |
| 37 | 33 | |
| 34 | #include <iostream> | |
| 35 | #include <string> | |
| 36 | #include <vector> | |
| 37 | #include <tr1/unordered_map> | |
| 38 | ||
| 38 | 39 | const int MAX_VOLUME_SCALE_FACTOR = 200; |
| 39 | 40 | // Default values - going to add settings adjustment, saving, loading and such |
| 40 | 41 | const int VOLUME_SCALER_MUTE = 0; |
| ... | ... | |
| 63 | 64 | }; |
| 64 | 65 | |
| 65 | 66 | using std::string; |
| 67 | using std::vector; | |
| 66 | 68 | using fastdelegate::FastDelegate0; |
| 67 | using google::dense_hash_map; | |
| 68 | 69 | |
| 69 | 70 | typedef FastDelegate0<> MenuAction; |
| 70 | typedef dense_hash_map<string, string, hash<string> > ConfStrHash; | |
| 71 | typedef dense_hash_map<string, int, hash<string> > ConfIntHash; | |
| 71 | typedef unordered_map<string, string, hash<string> > ConfStrHash; | |
| 72 | typedef unordered_map<string, int, hash<string> > ConfIntHash; | |
| 72 | 73 | |
| 73 | 74 | typedef struct { |
| 74 | 75 | unsigned short batt; |
| src/menusettingmultistring.cpp | ||
|---|---|---|
| 22 | 22 | #include "iconbutton.h" |
| 23 | 23 | #include "FastDelegate.h" |
| 24 | 24 | |
| 25 | #include <algorithm> | |
| 26 | ||
| 27 | using std::find; | |
| 25 | 28 | using std::string; |
| 26 | 29 | using std::vector; |
| 27 | 30 | using fastdelegate::MakeDelegate; |
Branches:
install_locations
master
opkrun
packages
