Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 21 Jul 2002 10:42:50 +0200 (MEST)
From:      Jan Stocker <Jan.Stocker@t-online.de>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        roman@xpert.com
Subject:   ports/40830: Make id3lib compile under gcc3.x
Message-ID:  <200207210842.g6L8goKY029838@twoflower.liebende.de>

next in thread | raw e-mail | index | archive | help

>Number:         40830
>Category:       ports
>Synopsis:       Make id3lib compile under gcc3.x
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jul 21 03:50:03 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Jan Stocker
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD twoflower 5.0-CURRENT FreeBSD 5.0-CURRENT #0: Thu Jul 18 08:40:25 CEST 2002 root@twoflower:/usr/obj/usr/src/sys/Twoflower50 i386
>Description:
Using non-standard ios::nocreate, no available casts from uchar* to char* and
using a non-standard ifstream-constructor leads to compile errors.
>How-To-Repeat:
Just do a make on -current.
>Fix:

diff -urN id3lib.orig/files/patch-tag_file.cpp id3lib/files/patch-tag_file.cpp
--- id3lib.orig/files/patch-tag_file.cpp	Thu Jan  1 01:00:00 1970
+++ id3lib/files/patch-tag_file.cpp	Sun Jul 21 10:22:59 2002
@@ -0,0 +1,69 @@
+--- src/tag_file.cpp.orig	Mon Sep 11 09:46:32 2000
++++ src/tag_file.cpp	Sun Jul 21 10:15:10 2002
+@@ -184,7 +184,7 @@
+     }
+   }
+   
+-  file.write(sTag, tag_size);
++  file.write((const char*) sTag, tag_size);
+ 
+   return tag_size;
+ }
+@@ -221,7 +221,7 @@
+     file.seekp(0, ios::beg);
+     if (buffer)
+     {
+-      file.write(buffer, tag_size);
++      file.write((const char*) buffer, tag_size);
+     }
+   }
+   else
+@@ -282,8 +282,9 @@
+       remove(sTempFile);
+       ID3_THROW_DESC(ID3E_NoFile, "couldn't open temp file");
+     }
+-
+-    ofstream tmpOut(fd);
++    
++    close(fd);
++    ofstream tmpOut(sTempFile);
+     if (!tmpOut)
+     {
+       tmpOut.close();
+@@ -292,15 +293,15 @@
+     }
+     if (buffer)
+     {
+-      tmpOut.write(buffer, tag_size);
++      tmpOut.write((const char*) buffer, tag_size);
+     }
+     file.seekg(tag.GetPrependedBytes(), ios::beg);
+     uchar buffer2[BUFSIZ];
+     while (file)
+     {
+-      file.read(buffer2, BUFSIZ);
++      file.read((char*) buffer2, BUFSIZ);
+       size_t nBytes = file.gcount();
+-      tmpOut.write(buffer2, nBytes);
++      tmpOut.write((const char*) buffer2, nBytes);
+     }
+       
+     tmpOut.close();
+@@ -431,7 +432,7 @@
+     while (!file.eof())
+     {
+       size_t nBytesToRead = MIN(nBytesRemaining - nBytesCopied, BUFSIZ);
+-      file.read(aucBuffer, nBytesToRead);
++      file.read((char*) aucBuffer, nBytesToRead);
+       size_t nBytesRead = file.gcount();
+ 
+       if (nBytesRead != nBytesToRead)
+@@ -444,7 +445,7 @@
+       {
+         long offset = nBytesRead + this->GetPrependedBytes();
+         file.seekp(-offset, ios::cur);
+-        file.write(aucBuffer, nBytesRead);
++        file.write((const char*) aucBuffer, nBytesRead);
+         file.seekg(this->GetPrependedBytes(), ios::cur);
+         nBytesCopied += nBytesRead;
+       }
diff -urN id3lib.orig/files/patch-tag_parse.cpp id3lib/files/patch-tag_parse.cpp
--- id3lib.orig/files/patch-tag_parse.cpp	Thu Jan  1 01:00:00 1970
+++ id3lib/files/patch-tag_parse.cpp	Sun Jul 21 10:23:11 2002
@@ -0,0 +1,20 @@
+--- src/tag_parse.cpp.orig	Fri Sep 15 01:54:08 2000
++++ src/tag_parse.cpp	Sun Jul 21 10:15:10 2002
+@@ -178,7 +178,7 @@
+     return 0;
+   }
+   uchar header[ID3_TAGHEADERSIZE];
+-  file.read(header, ID3_TAGHEADERSIZE);
++  file.read((char*) header, ID3_TAGHEADERSIZE);
+   if (file.gcount() != ID3_TAGHEADERSIZE)
+   {
+     return 0;
+@@ -188,7 +188,7 @@
+   if (tagSize > 0)
+   {
+     uchar* bin = new uchar[tagSize];
+-    file.read(bin, tagSize - ID3_TagHeader::SIZE);
++    file.read((char*) bin, tagSize - ID3_TagHeader::SIZE);
+     if (tagSize != (size_t)file.gcount())
+     {
+       // log this...
diff -urN id3lib.orig/files/patch-tag_parse_lyrics3.cpp id3lib/files/patch-tag_parse_lyrics3.cpp
--- id3lib.orig/files/patch-tag_parse_lyrics3.cpp	Thu Jan  1 01:00:00 1970
+++ id3lib/files/patch-tag_parse_lyrics3.cpp	Sun Jul 21 10:25:09 2002
@@ -0,0 +1,20 @@
+--- src/tag_parse_lyrics3.cpp.orig	Mon Sep 11 08:34:06 2000
++++ src/tag_parse_lyrics3.cpp	Sun Jul 21 10:15:10 2002
+@@ -200,7 +200,7 @@
+       // reserve enough space for lyrics3 + id3v1 tag
+       const size_t max_lyr_size = 11 + 5100 + 9 + 128;
+ 
+-      size_t lyr_buffer_size = MIN(max_lyr_size, file.tellg());
++      size_t lyr_buffer_size = MIN(max_lyr_size, (size_t) file.tellg());
+ 
+       file.seekg(- static_cast<long>(lyr_buffer_size), ios::cur);
+       if (!file)
+@@ -274,7 +274,7 @@
+       
+       // Using binary minus rather than unary minus to avoid compiler warning
+       
+-      file.seekg(- MIN(file.tellg(), 
++      file.seekg(- MIN((size_t) file.tellg(), 
+                        (static_cast<long>(lyr_size) + 6 + 9 + 3)), ios::cur);
+       if (!file)
+       {
diff -urN id3lib.orig/files/patch-tag_parse_musicmatch.cpp id3lib/files/patch-tag_parse_musicmatch.cpp
--- id3lib.orig/files/patch-tag_parse_musicmatch.cpp	Thu Jan  1 01:00:00 1970
+++ id3lib/files/patch-tag_parse_musicmatch.cpp	Sun Jul 21 10:23:46 2002
@@ -0,0 +1,50 @@
+--- src/tag_parse_musicmatch.cpp.orig	Mon Sep 11 09:46:32 2000
++++ src/tag_parse_musicmatch.cpp	Sun Jul 21 10:15:10 2002
+@@ -221,7 +221,7 @@
+     return 0;
+   }
+ 
+-  file.seekg(tag_end - tag_size);
++  file.seekg((size_t) tag_end - tag_size);
+   tag_beg = file.tellg();
+ 
+   // Now calculate the actual offsets
+@@ -229,17 +229,17 @@
+   offsets[0] = tag_beg;
+   for (size_t i = 0; i < 4; ++i)
+   {
+-    offsets[i+1] = offsets[i] + section_sizes[i];
++    offsets[i+1] = offsets[i] + (streampos) section_sizes[i];
+   }
+ 
+   // now check for a tag header and adjust the tag_beg pointer appropriately
+   if (tag_beg >= 256)
+   {
+-    file.seekg(tag_beg - 256);
++    file.seekg((size_t) tag_beg - 256);
+     file.read(sig, 8);
+     if (memcmp(sig, "18273645", 8) == 0)
+     {
+-      file.seekg(tag_beg - 256);
++      file.seekg((size_t) tag_beg - 256);
+       tag_beg = file.tellg();
+       file.ignore(256);
+     }
+@@ -267,7 +267,7 @@
+   {
+     // no image binary.  don't do anything.
+   }
+-  else if (offsets[0] + 4 + nImgSize > static_cast<size_t>(offsets[2]))
++  else if ((size_t) offsets[0] + 4 + nImgSize > static_cast<size_t>(offsets[2]))
+   {
+     // Ack!  The image size given extends beyond the next offset!  This is 
+     // not good...  log?
+@@ -275,7 +275,7 @@
+   else
+   {
+     uchar* img_data = new uchar[nImgSize];
+-    file.read(img_data, nImgSize);
++    file.read((char*) img_data, nImgSize);
+     ID3_Frame* frame = new ID3_Frame(ID3FID_PICTURE);
+     if (frame)
+     {
diff -urN id3lib.orig/files/patch-tag_parse_v1.cpp id3lib/files/patch-tag_parse_v1.cpp
--- id3lib.orig/files/patch-tag_parse_v1.cpp	Thu Jan  1 01:00:00 1970
+++ id3lib/files/patch-tag_parse_v1.cpp	Sun Jul 21 10:24:01 2002
@@ -0,0 +1,11 @@
+--- src/tag_parse_v1.cpp.orig	Mon Sep 11 08:34:06 2000
++++ src/tag_parse_v1.cpp	Sun Jul 21 10:15:10 2002
+@@ -67,7 +67,7 @@
+   {
+     const size_t data_size = ID3_V1_LEN - ID3_V1_LEN_ID;
+     uchar tag_bytes[data_size];
+-    file.read(tag_bytes, data_size);
++    file.read((char*) tag_bytes, data_size);
+     if (file.gcount() != data_size)
+     {
+       return num_bytes;
diff -urN id3lib.orig/files/patch-utils.cpp id3lib/files/patch-utils.cpp
--- id3lib.orig/files/patch-utils.cpp	Thu Jan  1 01:00:00 1970
+++ id3lib/files/patch-utils.cpp	Sun Jul 21 10:24:13 2002
@@ -0,0 +1,38 @@
+--- src/utils.cpp.orig	Mon Sep 11 09:46:32 2000
++++ src/utils.cpp	Sun Jul 21 10:15:10 2002
+@@ -231,7 +231,7 @@
+ 
+   bool exists(const char *name)
+   {
+-    ifstream file(name, ios::nocreate);
++    ifstream file(name/*, ios::nocreate*/);
+     return file.is_open() != 0;
+   }
+   
+@@ -256,7 +256,7 @@
+     size_t size = 0;
+     if (file.is_open())
+     {
+-      streamoff curpos = file.tellp();
++      streampos curpos = file.tellp();
+       file.seekp(0, ios::end);
+       size = file.tellp();
+       file.seekp(curpos);
+@@ -275,7 +275,7 @@
+     {
+       file.close();
+     }
+-    file.open(name, ios::in | ios::out | ios::binary | ios::nocreate);
++    file.open(name, ios::in | ios::out | ios::binary /*| ios::nocreate*/);
+     if (!file)
+     {
+       return ID3E_ReadOnly;
+@@ -290,7 +290,7 @@
+     {
+       file.close();
+     }
+-    file.open(name, ios::in | ios::binary | ios::nocreate);
++    file.open(name, ios::in | ios::binary /*| ios::nocreate*/);
+     if (!file)
+     {
+       return ID3E_NoFile;

>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200207210842.g6L8goKY029838>