diff options
author | Mike Frysinger <vapier@gentoo.org> | 2005-09-10 05:32:25 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2005-09-10 05:32:25 +0000 |
commit | 9d74f50aff02cea4807f4352a98529092d2fd95d (patch) | |
tree | 048d9a41c8f4e199d5b92795b33aa25111a98967 /app-cdr/pxlinux | |
parent | Added ~sparc keyword. (diff) | |
download | gentoo-2-9d74f50aff02cea4807f4352a98529092d2fd95d.tar.gz gentoo-2-9d74f50aff02cea4807f4352a98529092d2fd95d.tar.bz2 gentoo-2-9d74f50aff02cea4807f4352a98529092d2fd95d.zip |
Cleanup the code a bit #105432.
(Portage version: 2.0.51.22-r2)
Diffstat (limited to 'app-cdr/pxlinux')
-rw-r--r-- | app-cdr/pxlinux/ChangeLog | 6 | ||||
-rw-r--r-- | app-cdr/pxlinux/files/pxlinux-0.0.4-cleanups.patch | 267 | ||||
-rw-r--r-- | app-cdr/pxlinux/pxlinux-0.0.4.ebuild | 5 |
3 files changed, 276 insertions, 2 deletions
diff --git a/app-cdr/pxlinux/ChangeLog b/app-cdr/pxlinux/ChangeLog index ac061228014f..b0233aa1892b 100644 --- a/app-cdr/pxlinux/ChangeLog +++ b/app-cdr/pxlinux/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for app-cdr/pxlinux # Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-cdr/pxlinux/ChangeLog,v 1.2 2005/06/07 09:33:10 dholm Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-cdr/pxlinux/ChangeLog,v 1.3 2005/09/10 05:32:25 vapier Exp $ + + 10 Sep 2005; Mike Frysinger <vapier@gentoo.org> + +files/pxlinux-0.0.4-cleanups.patch, pxlinux-0.0.4.ebuild: + Cleanup the code a bit #105432. 07 Jun 2005; David Holm <dholm@gentoo.org> pxlinux-0.0.4.ebuild: Added to ~ppc. diff --git a/app-cdr/pxlinux/files/pxlinux-0.0.4-cleanups.patch b/app-cdr/pxlinux/files/pxlinux-0.0.4-cleanups.patch new file mode 100644 index 000000000000..7d372e719016 --- /dev/null +++ b/app-cdr/pxlinux/files/pxlinux-0.0.4-cleanups.patch @@ -0,0 +1,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, ¤t_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, ¤t_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 diff --git a/app-cdr/pxlinux/pxlinux-0.0.4.ebuild b/app-cdr/pxlinux/pxlinux-0.0.4.ebuild index 75375494768d..8c3a0e2b33aa 100644 --- a/app-cdr/pxlinux/pxlinux-0.0.4.ebuild +++ b/app-cdr/pxlinux/pxlinux-0.0.4.ebuild @@ -1,6 +1,8 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-cdr/pxlinux/pxlinux-0.0.4.ebuild,v 1.2 2005/06/07 09:33:10 dholm Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-cdr/pxlinux/pxlinux-0.0.4.ebuild,v 1.3 2005/09/10 05:32:25 vapier Exp $ + +inherit eutils DESCRIPTION="PlexTools-like app for Plextor drives in linux" HOMEPAGE="http://www-user.tu-chemnitz.de/~noe/Plextor/" @@ -18,6 +20,7 @@ S=${WORKDIR}/${PN} src_unpack() { unpack ${A} cd "${S}" + epatch "${FILESDIR}"/${P}-cleanups.patch rm -f Makefile } |