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
|
diff -w -b -B -u -U 5 -r -P -x *~ -x *.[oa] id3lib-3.8.0pre2/src/tag_file.cpp id3lib-3.8.0pre2.doj/src/tag_file.cpp
--- id3lib-3.8.0pre2/src/tag_file.cpp Sat Sep 8 04:30:18 2001
+++ id3lib-3.8.0pre2.doj/src/tag_file.cpp Thu Oct 4 23:22:40 2001
@@ -268,18 +268,11 @@
}
char sTempFile[ID3_PATH_LENGTH];
strcpy(sTempFile, filename.c_str());
strcat(sTempFile, sTmpSuffix.c_str());
- int fd = mkstemp(sTempFile);
- if (fd < 0)
- {
- remove(sTempFile);
- //ID3_THROW_DESC(ID3E_NoFile, "couldn't open temp file");
- }
-
- ofstream tmpOut(fd);
+ ofstream tmpOut(sTempFile);
if (!tmpOut)
{
tmpOut.close();
remove(sTempFile);
return 0;
@@ -290,13 +283,13 @@
tmpOut.write(tagData, tagSize);
file.seekg(tag.GetPrependedBytes(), ios::beg);
uchar tmpBuffer[BUFSIZ];
while (file)
{
- file.read(tmpBuffer, BUFSIZ);
+ file.read((char *)tmpBuffer, BUFSIZ);
size_t nBytes = file.gcount();
- tmpOut.write(tmpBuffer, nBytes);
+ tmpOut.write((char *)tmpBuffer, nBytes);
}
tmpOut.close();
file.close();
diff -w -b -B -u -U 5 -r -P -x *~ -x *.[oa] id3lib-3.8.0pre2/src/utils.cpp id3lib-3.8.0pre2.doj/src/utils.cpp
--- id3lib-3.8.0pre2/src/utils.cpp Sat Sep 8 04:30:18 2001
+++ id3lib-3.8.0pre2.doj/src/utils.cpp Thu Oct 4 23:31:17 2001
@@ -31,12 +31,14 @@
#if defined HAVE_ICONV_H
# include <iconv.h>
# include <errno.h>
#endif
-#include <ctype.h>
-#include <iostream.h>
+#include <cctype>
+#include <iostream>
+#include <string>
+using namespace std;
#ifdef macintosh
#define NOCREATE ((std::ios_base::openmode)0)
#define toascii(X) (X)
#else
@@ -115,11 +117,11 @@
size_t target_size = BUFSIZ;
do
{
size_t nconv = iconv(cd,
- &source_str, &source_size,
+ (char **)&source_str, &source_size,
&target_str, &target_size);
if (nconv == (size_t) -1 && errno != EINVAL && errno != E2BIG)
{
return target;
}
@@ -214,11 +216,11 @@
namespace
{
bool exists(String name)
{
- ifstream file(name.c_str(), NOCREATE);
+ ifstream file(name.c_str()/*, NOCREATE*/);
return file.is_open() != 0;
}
};
ID3_Err dami::createFile(String name, fstream& file)
@@ -285,11 +287,11 @@
if (file.is_open())
{
file.close();
}
- file.open(name.c_str(), ios::in | ios::out | ios::binary | NOCREATE);
+ file.open(name.c_str(), ios::in | ios::out | ios::binary /*| NOCREATE*/);
if (!file)
{
return ID3E_ReadOnly;
}
@@ -305,11 +307,11 @@
if (file.is_open())
{
file.close();
}
- file.open(name.c_str(), ios::in | ios::out | ios::binary | NOCREATE);
+ file.open(name.c_str(), ios::in | ios::out | ios::binary /*| NOCREATE*/);
if (!file)
{
return ID3E_ReadOnly;
}
@@ -320,11 +322,11 @@
{
if (file.is_open())
{
file.close();
}
- file.open(name.c_str(), ios::in | ios::binary | NOCREATE);
+ file.open(name.c_str(), ios::in | ios::binary /*| NOCREATE*/);
if (!file)
{
return ID3E_NoFile;
}
@@ -335,11 +337,11 @@
{
if (file.is_open())
{
file.close();
}
- file.open(name.c_str(), ios::in | ios::binary | NOCREATE);
+ file.open(name.c_str(), ios::in | ios::binary /*| NOCREATE*/);
if (!file)
{
return ID3E_NoFile;
}
|