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
2121#include <iostream>
2222#include <sstream>
2323#include <fstream>
24#include <algorithm>
2425#include <stdlib.h>
2526#include <unistd.h>
2627#include <math.h>
...... 
170171    f200 = true;
171172#endif
172173
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
182174    //open2x
183175    savedVolumeMode = 0;
184176    volumeMode = VOLUME_MODE_NORMAL;
src/gmenu2x.h
2121#ifndef GMENU2X_H
2222#define GMENU2X_H
2323
24#include <string>
25#include <iostream>
26
27#include "google/dense_hash_map"
2824#include "surfacecollection.h"
2925#include "iconbutton.h"
3026#include "translator.h"
...... 
3531#include "asfont.h"
3632#include "surface.h"
3733
34#include <iostream>
35#include <string>
36#include <vector>
37#include <tr1/unordered_map>
38
3839const int MAX_VOLUME_SCALE_FACTOR = 200;
3940// Default values - going to add settings adjustment, saving, loading and such
4041const int VOLUME_SCALER_MUTE = 0;
...... 
6364};
6465
6566using std::string;
67using std::vector;
6668using fastdelegate::FastDelegate0;
67using google::dense_hash_map;
6869
6970typedef FastDelegate0<> MenuAction;
70typedef dense_hash_map<string, string, hash<string> > ConfStrHash;
71typedef dense_hash_map<string, int, hash<string> > ConfIntHash;
71typedef unordered_map<string, string, hash<string> > ConfStrHash;
72typedef unordered_map<string, int, hash<string> > ConfIntHash;
7273
7374typedef struct {
7475    unsigned short batt;
src/menusettingmultistring.cpp
2222#include "iconbutton.h"
2323#include "FastDelegate.h"
2424
25#include <algorithm>
26
27using std::find;
2528using std::string;
2629using std::vector;
2730using fastdelegate::MakeDelegate;

Archive Download the corresponding diff file



interactive