Commits

Wez Furlong committed 0446a90

remove unused variables, tidy up

  • Participants
  • Parent commits 3e00300

Comments (0)

Files changed (6)

File configure.ac

 
 AM_PROG_CC_C_O
 AC_PROG_CXX
+if test "$GCC" = "yes" ; then
+  CFLAGS="$CFLAGS -Wall"
+  CXXFLAGS="$CXXFLAGS -Wall"
+fi
 AC_PROG_OBJC
 
 AC_HEADER_DIRENT

File src/AP_CDTOC.cpp

 #endif
 
 
-/*ŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃ
-MCDI describes the CD TOC - actually talks about "a binary dump of the TOC". So, a TOC is made up of:
-a 4 byte TOC header (2 bytes length of the entire TOC, 1 byte start session, 1 byte end session)
-an array of track entries, and depending on the mode, of varying lengths. For audio CDs, TOC track entries are mode1 (or for CD-R/RW mode5, but lets stick to mode1)
-a mode1 track entry is 11 bytes:
-1byte session, 1 byte (packed control/address), 1byte NULL (unused TNO), 1 byte for tracknumber (expressed as the word POINT in mmc nomenclature), 3bytes relative start frametime, 1 byte NULL, 3 bytes duration timeframe
+/*
+MCDI describes the CD TOC - actually talks about "a binary dump of the TOC".
+So, a TOC is made up of: a 4 byte TOC header (2 bytes length of the entire TOC,
+1 byte start session, 1 byte end session) an array of track entries, and
+depending on the mode, of varying lengths. For audio CDs, TOC track entries are
+mode1 (or for CD-R/RW mode5, but lets stick to mode1) a mode1 track entry is 11
+bytes: 1byte session, 1 byte (packed control/address), 1byte NULL (unused TNO),
+1 byte for tracknumber (expressed as the word POINT in mmc nomenclature),
+3bytes relative start frametime, 1 byte NULL, 3 bytes duration timeframe
 
-while "binary dump of the TOC" is there, its also modified so that the timeframe listing in mm:ss::frames (3bytes) is converted to a 4byte LBA timecode.
-Combining the first 4 bytes of the "binary dump of the TOC" with the modifications of the 3byte(frame)->4byte(block), we arrive at MCDI as:
+while "binary dump of the TOC" is there, its also modified so that the
+timeframe listing in mm:ss::frames (3bytes) is converted to a 4byte LBA
+timecode.  Combining the first 4 bytes of the "binary dump of the TOC" with the
+modifications of the 3byte(frame)->4byte(block), we arrive at MCDI as:
+
 struct mcdi_track_entry {
   uint8_t   cd_toc_session;
   uint8_t   cd_toc_controladdress; //bitpacked uint4_t of control & address
   struct mcdi_track_entry lead_out;
   };
 
-The problem with including the TOC header is that it can't be used directly because on the CD toc entries are 3byte msf address, but here they are 4byte LBA. In any event
-this header should not have ever been included because the length can be deduced from the frame length & tracks by dividing by 8. So, the header length that MCDI refers to:
-is it for MSF or LBA addressing? Well, since the rest of MCDI is LBA-based, lets say LBA - which means it needs to be calculated. As it just so happens, then its the
-length of the frame. All that needs to be added are the first & last tracks.
+The problem with including the TOC header is that it can't be used directly
+because on the CD toc entries are 3byte msf address, but here they are 4byte
+LBA. In any event this header should not have ever been included because the
+length can be deduced from the frame length & tracks by dividing by 8. So, the
+header length that MCDI refers to: is it for MSF or LBA addressing? Well, since
+the rest of MCDI is LBA-based, lets say LBA - which means it needs to be
+calculated. As it just so happens, then its the length of the frame. All that
+needs to be added are the first & last tracks.
 
-Unfortunately, this frame can't be used as a CD Identifier *AS IS* across platforms. Because the leadout track is platform specific (a Linux leadout is 0xAA, MacOSX leadout
-is 0xA2), consideration of the leadout track would have to be given by anything else using this frame.
-ŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃŃ*/
+Unfortunately, this frame can't be used as a CD Identifier *AS IS* across
+platforms. Because the leadout track is platform specific (a Linux leadout is
+0xAA, MacOSX leadout is 0xA2), consideration of the leadout track would have to
+be given by anything else using this frame.
 
-///////////////////////////////////////////////////////////////////////////////////////
-//                      Generating MCDI data from a CD TOC                           //
-///////////////////////////////////////////////////////////////////////////////////////
+*/
+
+///////////////////////////////////////////////////////////////////////////
+//          Generating MCDI data from a CD TOC                           //
+///////////////////////////////////////////////////////////////////////////
 
 uint8_t DataControlField(uint8_t controlfield) {
 #if defined (__ppc__) || defined (__ppc64__)
 	return mcdi_len;
 }
 
-///////////////////////////////////////////////////////////////////////////////////////
-//                                Platform Specifics                                 //
-///////////////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+//                      Platform Specifics                                 //
+/////////////////////////////////////////////////////////////////////////////
 
 #if defined (HAVE_LINUX_CDROM_H)
 void Linux_ReadCDTOC(int cd_fd) {
 		return;
 	}
 	cdTOC = (CD_TOC_*)calloc(1, sizeof(CD_TOC_));
-	//cdTOC->toc_length = 0; //not used anyway
-	//cdTOC->first_session = 0; //not used anyway
-	//cdTOC->last_session = 0; //not used anyway
 	cdTOC->track_description = NULL;
 
 	for (uint8_t i = toc_header.cdth_trk0; i <= toc_header.cdth_trk1+1; i++) {
 		toc_entry.cdte_format = CDROM_MSF; //although it could just be easier to use CDROM_LBA
 		
 		if (ioctl(cd_fd, CDROMREADTOCENTRY, &toc_entry) == -1) {
-      fprintf(stderr, "AtomicParsley error: there was an error reading a CD Table of Contents entry (linux cdrom).\n");
+			fprintf(stderr,
+				"AtomicParsley error: there was an error reading a "
+				"CD Table of Contents entry (linux cdrom).\n");
 			return;
-    }
+		}
 		
 		if (cdTOC->track_description == NULL) {
 			cdTOC->track_description = (CD_TDesc*)calloc(1, (sizeof(CD_TDesc)));
 												
 	cdTOCdata = (CFDataRef)CFDictionaryGetValue(cd_props, CFSTR (kIOCDMediaTOCKey));
 	if (cdTOCdata != NULL) {
-		uint16_t cdTOClen = Extract_cdTOCrawdata(cdTOCdata, cdTOCrawdata);
+	   	Extract_cdTOCrawdata(cdTOCdata, cdTOCrawdata);
 	}
 	CFRelease(cd_props);
 	cd_props = NULL;
 }
 #endif
 
-///////////////////////////////////////////////////////////////////////////////////////
-//                                 CD TOC Entry Area                                 //
-///////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////
+//                      CD TOC Entry Area                                 //
+////////////////////////////////////////////////////////////////////////////
 
 uint16_t GenerateMCDIfromCD(const char* drive, char* dest_buffer) {
 	uint16_t mcdi_bytes = 0;

File src/AP_ID3v2_tags.cpp

 	char* utf8str = NULL;
 	uint8_t targetfield = 0xFF;
 	uint8_t textencoding = 0;
-	uint32_t utf8maxalloc = 0;
 	
 	for (uint8_t frm_field = 0; frm_field < targetframe->ID3v2_FieldCount; frm_field++) {
 		if ( (targetframe->ID3v2_Frame_Fields+frm_field)->ID3v2_Field_Type == fieldtype) {
 ----------------------*/
 void APar_ID3FrameAmmend(AtomicInfo* id32_atom, const char* frame_str, const char* frame_payload, AdjunctArgs* adjunct_payloads, uint8_t str_encoding) {
 	ID3v2Frame* targetFrame = NULL;
-	ID3v2Frame* eval_frame = NULL;
 	
 	if (id32_atom == NULL) return;
 	GlobalID3Tag = id32_atom->ID32_TagInfo;

File src/AP_MetadataListings.cpp

 	
 	int frameID = MatchID3FrameIDstr(frame_str, id32_atom->ID32_TagInfo->ID3v2Tag_MajorVersion);
 	int frameType = KnownFrames[frameID+1].ID3v2_FrameType;
-	uint8_t frameCompositionList = GetFrameCompositionDescription(frameType);
 	
 	if (destination_folder == NULL) {
 		basepath_len = (strrchr(originfile, '.') - originfile);

File src/AtomicParsley.cpp

 #endif
 	
 	for (uint16_t an_item=1; an_item <= item_count; an_item++) {
-		uint16_t an_item_ID = UInt16FromBigEndian(parsedAtoms[iloc_number].AtomicData+aggregate_offset);
+#ifdef DEBUG_V
+		uint16_t an_item_ID = 
+#endif
+		UInt16FromBigEndian(parsedAtoms[iloc_number].AtomicData+aggregate_offset);
 		uint16_t a_data_ref_idx = UInt16FromBigEndian(parsedAtoms[iloc_number].AtomicData+aggregate_offset+2);
 		uint64_t base_offset = 0;
 		uint64_t curr_container_pos = 0;
 	memset(tfhd_atomFlags_scrap, 0, 10);
 	//parsedAtoms[tfhd_number].AtomicVerFlags = APar_read32(tfhd_atomFlags_scrap, source_file, parsedAtoms[tfhd_number].AtomicStart+8);
  
-	if (parsedAtoms[tfhd_number].AtomicVerFlags & 0x01) { //seems the atomflags suggest bitpacking, but the spec doesn't specify it; if the 1st bit is set...
+	if (parsedAtoms[tfhd_number].AtomicVerFlags & 0x01) {
+		// seems the atomflags suggest bitpacking, but the spec doesn't specify it;
+		// if the 1st bit is set...
+#if 0 /* not used */
 		memset(tfhd_atomFlags_scrap, 0, 10);	
 		memcpy(tfhd_atomFlags_scrap, parsedAtoms[tfhd_number].AtomicData, 4);
 		
 		uint32_t track_ID = UInt32FromBigEndian(tfhd_atomFlags_scrap); //unused
+#endif
 		uint64_t tfhd_offset = UInt64FromBigEndian(parsedAtoms[tfhd_number].AtomicData +4);
 		
 		if (!determined_offset) {
 		return;
 	}
 	uint64_t mdat_pos = 0;
-	uint64_t moov_udta_pos = APar_QuickSumAtomicLengths(dynUpd.moov_udta_atom);
-	uint64_t moov_last_trak_pos = APar_QuickSumAtomicLengths(dynUpd.last_trak_child_atom);
-	uint64_t moov_meta_pos = APar_QuickSumAtomicLengths(dynUpd.moov_meta_atom);
+  //uint64_t moov_udta_pos = APar_QuickSumAtomicLengths(dynUpd.moov_udta_atom);
+	//uint64_t moov_last_trak_pos = APar_QuickSumAtomicLengths(dynUpd.last_trak_child_atom);
+	//uint64_t moov_meta_pos = APar_QuickSumAtomicLengths(dynUpd.moov_meta_atom);
 	uint64_t moov_pos = APar_QuickSumAtomicLengths(dynUpd.moov_atom);
 	uint64_t root_meta_pos = APar_QuickSumAtomicLengths(dynUpd.file_meta_atom);
 	

File src/main.cpp

 				uint8_t a_track = 0;//unused
 				char atom_path[100];
 				AtomicInfo* video_desc_atom = NULL;
-				AtomicInfo* ipod_uuid = NULL;
 				
 				memset(atom_path, 0, 100);