blob: 7b1728003fe8d01aabbc156b13b3444e0ad00149 (
plain)
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
|
echo 'Creating brew-patch.diff'
cat << EOF >> brew-patch.diff
--- formatter.cpp
+++ formatter.cpp
@@ -58,7 +58,7 @@ Formatter::Formatter(unsigned char *data, int offset)
if ((c.type == INT_ARG) || (c.type == STRING_ARG) ||
(c.type == FLOAT_ARG) || (c.type == DOUBLE_ARG))
{
- int no = (int)c.data;
+ int no = *((int*)(&c.data));
args[no - 1] = c.type;
}
}
@@ -135,7 +135,7 @@ std::wstring Formatter::format(std::vector<ArgValue*> &argValues) const
case STRING_ARG:
case INT_ARG:
- no = (int)cmd->data - 1;
+ no = *((int*)(&cmd->data)) - 1;
if (no < (int)argValues.size())
s += argValues[no]->format(cmd);
break;
--- main.cpp
+++ main.cpp
@@ -61,13 +61,9 @@ static void loadResources(const std::wstring &selfPath)
#ifdef WIN32
dirs.push_back(getStorage()->get(L"path", L"") + L"\\res");
#else
-#ifdef __APPLE__
- dirs.push_back(getResourcesPath(selfPath));
-#else
dirs.push_back(PREFIX L"/share/einstein/res");
dirs.push_back(fromMbcs(getenv("HOME")) + L"/.einstein/res");
#endif
-#endif
dirs.push_back(L"res");
dirs.push_back(L".");
resources = new ResourcesCollection(dirs);
EOF
|