summaryrefslogtreecommitdiff
blob: 7d372e7190160d7e95f079e147b2f4d7ca018c5c (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
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
Remove unused variables/functions and fix misc warnings

--- pxlinux/jitterbeta.cpp
+++ pxlinux/jitterbeta.cpp
@@ -364,15 +364,13 @@
 
         Scsi_Command  cmd;
 
-	int err;
-
 	if (!cmd.associate(drive))
 	  fprintf (stderr,"%s: unable to open: ",drive),
 	    perror (NULL),
 	    exit (1);
 
 	for (int i=0;i<16;i++) {
-		int j = read_one_ecc_block(drive, pBuffer, lba);
+		read_one_ecc_block(drive, pBuffer, lba);
 		//if (j == COMMAND_FAILED) i=16;
 		lba += 16;
 	}
@@ -394,7 +394,7 @@
 {
     int capacity;
     char *drive; 
-    int** result_map;
+    int* result_map;
     int *speed;
     int interval;
   
@@ -427,7 +426,7 @@
 	int			 jitter, k;
 	unsigned int value;
 	int			 produce_map = 0;
-	void*		 pBuffer  = malloc(32768);
+	char*		 pBuffer[32768];
 
 
 	if (!capacity) read_capacity(drive, &capacity);
@@ -445,17 +445,15 @@
 	//	ReleaseSemaphore(hSemaphore, 1, NULL);
 	//}
 
-	if (result_map) {
-		*result_map = (int*)calloc(sizeof(int), capacity+1);
-		(*result_map)[0] = capacity;
+		result_map = (int*)calloc(sizeof(int), capacity+1);
+		result_map[0] = capacity;
 		produce_map = 1;
-	}
 
 	for (k = 0;k<capacity;k=k+interval) {
 		plextor_jitterbeta_do_16_ecc_blocks(drive, pBuffer, k*16*16, &jitter, &beta);
 
 		value = (beta) << 16 | (jitter & 0xFFFF);
-		if (produce_map) (*result_map)[k+1] = value;
+		if (produce_map) result_map[k+1] = value;
 
 		//printf("\r(%5.1f%%) LBA: %06X  jitter: %4d,  beta: %4d", (float)k*100/capacity,
 		//	k*16*16, jitter, (int)beta);
@@ -476,7 +475,6 @@
 
 
 	plextor_end_pi(drive);
-	delete pBuffer;
 	return 1;
 
 }
--- pxlinux/pif.cpp
+++ pxlinux/pif.cpp
@@ -346,7 +346,7 @@
 	//memset( &srbExec, 0, sizeof(SRB_ExecSCSICmd) );
 
 	for (int i=0;i<8;i++) {
-		int j = read_one_ecc_block(drive, pBuffer, lba);
+		read_one_ecc_block(drive, pBuffer, lba);
 		//if (j == COMMAND_FAILED) i = 8;
 		lba += 16;
 	}
@@ -366,7 +366,7 @@
 {
     int capacity;
     char *drive; 
-    int** result_map;
+    int* result_map;
     int *speed;
     int interval;
   
@@ -391,11 +392,10 @@
     //printf("%d",speed);
 
 
-	void*	pBuffer  = malloc(32768);
+	char*	pBuffer[32768];
 	long    capacity_in_bytes;
 
 	int		scan_start_time;
-	int		scan_end_time;
 	int		last_update;
 	int		produce_map = 0;
 
@@ -414,11 +414,9 @@
 	printf("#disc capacity: %d sectors = %d ECC blocks\n\n", capacity, capacity >> 4);
 	capacity >>= 7;
 
-	if (result_map) {
-		*result_map = (int*)calloc(sizeof(int), capacity+1);
-		(*result_map)[0] = capacity;
+		result_map = (int*)calloc(sizeof(int), capacity+1);
+		result_map[0] = capacity;
 		produce_map = 1;
-	}
 
 	//if (virtual_file) {
 	//	*virtual_file++ = capacity;
@@ -442,7 +440,7 @@
 	for (k = 0;k<capacity;k=k+interval) {
 		plextor_pif_do_one_ecc_block(drive, pBuffer, k*16*8, &current_error_count);
 		total_error_count += current_error_count;
-		if (produce_map) (*result_map)[k+1] = current_error_count;
+		if (produce_map) result_map[k+1] = current_error_count;
 		if (max_error_count < current_error_count) max_error_count = current_error_count;
 		if (current_error_count > 4) broken_count++;
 
@@ -472,7 +470,7 @@
 			//}
 
 	total_error_count = 0;
-	for (k=0;k<capacity;total_error_count+=(*result_map)[k+++1]);
+	for (k=0;k<capacity;total_error_count+=result_map[k+++1]);
 
 	//if (!silent) {
 		printf("#\r#total error count                                   : %8d         \n", total_error_count);
@@ -486,7 +487,5 @@
 
 	//if (!silent) printf("duration                                            : %d seconds\n", (scan_end_time - scan_start_time) / 1000);
 
-	delete pBuffer;
-
 	return 1;
 }
--- pxlinux/pisum8.cpp
+++ pxlinux/pisum8.cpp
@@ -347,7 +347,7 @@
 	//memset( &srbExec, 0, sizeof(SRB_ExecSCSICmd) );
 
 	for (int i=0;i<8;i++) {
-		int j = read_one_ecc_block(drive, pBuffer, lba);
+		read_one_ecc_block(drive, pBuffer, lba);
 		//if (j == COMMAND_FAILED) i = 8;
 		lba += 16;
 	}
@@ -367,7 +367,7 @@
 {
     int capacity;
     char *drive; 
-    int** result_map;
+    int* result_map;
     int *speed;
     int interval;
   
@@ -393,11 +394,10 @@
     //printf("%d",speed);
 
 
-	void*	pBuffer  = malloc(32768);
+	char*	pBuffer[32768];
 	long    capacity_in_bytes;
 
 	int		scan_start_time;
-	int		scan_end_time;
 	int		last_update;
 	int		produce_map = 0;
 //	int     m;
@@ -417,11 +417,9 @@
 	printf("#disc capacity: %d sectors = %d ECC blocks\n\n", capacity, capacity >> 4);
 	capacity >>= 7;
 
-	if (result_map) {
-		*result_map = (int*)calloc(sizeof(int), capacity+1);
-		(*result_map)[0] = capacity;
+		result_map = (int*)calloc(sizeof(int), capacity+1);
+		result_map[0] = capacity;
 		produce_map = 1;
-	}
 
 	//if (virtual_file) {
 	//	*virtual_file++ = capacity;
@@ -444,7 +442,7 @@
 	for (k = 0;k<capacity;k=k+interval) {
 		plextor_pisum8_do_eight_ecc_blocks(drive, pBuffer, k*16*8, &current_error_count);
 		total_error_count += current_error_count;
-		if (produce_map) (*result_map)[k+1] = current_error_count;
+		if (produce_map) result_map[k+1] = current_error_count;
 		if (max_error_count < current_error_count) max_error_count = current_error_count;
 		if (current_error_count > 280) broken_count++;
 
@@ -474,7 +472,7 @@
 			//}
 
 	total_error_count = 0;
-	for (k=0;k<capacity;total_error_count+=(*result_map)[k+++1]);
+	for (k=0;k<capacity;total_error_count+=result_map[k+++1]);
 
 	//if (!silent) {
 		printf("#\r#total error count                                   : %8d         \n", total_error_count);
@@ -488,7 +489,5 @@
 
 	//if (!silent) printf("duration                                            : %d seconds\n", (scan_end_time - scan_start_time) / 1000);
 
-	delete pBuffer;
-
 	return 1;
 }
--- pxlinux/ta.cpp
+++ pxlinux/ta.cpp
@@ -68,7 +68,6 @@
 {
 	int* dest[] = { dest_land, dest_pit };
 
-	int size = swap2(response_data);
 	int count = swap2(response_data+2);
 	response_data+=28;
 
@@ -94,7 +93,7 @@
 
 	for (int k=0;k<2;k++) {
 		j1=0; j2=0; local_max = 0;
-		for (int i=40;i<330;i++) {
+		for (i=40;i<330;i++) {
 			if (src[k][i-1] <= src[k][i] && src[k][i+1] <= src[k][i] && src[k][i] > 20 && src[k][i] > local_max) {
 				peaks[k][j1] = i;
 				local_max = src[k][i];
@@ -144,13 +143,9 @@
 {
 
 Scsi_Command	cmd;
-  unsigned char	header[40],inq[128],*page2A=NULL;
-  char		cmdname[64];
   //  int		i,j,ntracks,err,dvd_dash=0,dvd_plus=0,
   //	plus_mediaid_printed=0,page2A_printed=0,dvd_ram_spare=0;
-  unsigned short profile,dvd_0E=0,dvd_10=0,dvd_11=0,dvd_0A=0,dvd_C0=0;
   //char data [65536]; //= {0x00,0x00,0,0,0,0,0,0};
-  char *pDest;
   int layers;
 
 
--- pxlinux/transport.hxx
+++ pxlinux/transport.hxx
@@ -1271,6 +1271,8 @@
 #error "Unsupported OS"
 #endif
 
+#if 0
+
 #define DUMP_EVENTS 0
 static int handle_events (Scsi_Command &cmd)
 { unsigned char  event[8];
@@ -1599,6 +1601,8 @@
 }
 #undef FEATURE21_BROKEN
 
+#endif
+
 #undef ERRCODE
 #undef CREAM_ON_ERRNO
 #undef CREAM_ON_ERRNO_NAKED