audio/zinf: unbreak with libc++ 3.9

src/Http.cpp:771:11: error: cannot initialize a variable of type 'char *' with an rvalue of type 'const char *'
    char* cp = strstr(buffer, "Content-Length:");
          ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/downloadmanager.cpp:401:15: error: cannot initialize a variable of type 'char *' with an rvalue
      of type 'const char *'
        char* extension = strrchr(url, '.');
              ^           ~~~~~~~~~~~~~~~~~
src/downloadmanager.cpp:561:11: error: cannot initialize a variable of type 'char *' with an rvalue
      of type 'const char *'
    char* cp = strstr(buffer, "Content-Length:");
          ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/downloadmanager.cpp:575:11: error: cannot initialize a variable of type 'char *' with an rvalue
      of type 'const char *'
    char* cp = strstr(buffer, "Last-Modified:");
          ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/downloadmanager.cpp:799:24: error: assigning to 'char *' from incompatible type 'const char *'
                file = strchr(item->SourceURL().c_str() + 7, '/');
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/player.cpp:552:21: error: assigning to 'char *' from incompatible type 'const char *'
        extension = strrchr(url.c_str(), '.');
                    ^~~~~~~~~~~~~~~~~~~~~~~~~
src/player.cpp:1109:17: error: assigning to 'char *' from incompatible type 'const char *'
   temp_proto = strstr(title, "://");
                ^~~~~~~~~~~~~~~~~~~~
src/player.cpp:1129:15: error: assigning to 'char *' from incompatible type 'const char *'
   temp_ext = strrchr(title, '.');
              ^~~~~~~~~~~~~~~~~~~
src/player.cpp:1964:14: error: cannot initialize a variable of type 'char *' with an rvalue of type
      'const char *'
       char *port = strchr(buffer.c_str(),':');
             ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~
src/playlist.cpp:1964:15: error: cannot initialize a variable of type 'char *' with an rvalue of type
      'const char *'
        char* extension = strrchr(url, '.');
              ^           ~~~~~~~~~~~~~~~~~
src/playlist.cpp:2045:15: error: cannot initialize a variable of type 'char *' with an rvalue of type
      'const char *'
        char* extension = strrchr(url, '.');
              ^           ~~~~~~~~~~~~~~~~~
src/ThemeZip.cpp:150:15: error: assigning to 'char *' from incompatible type 'const char *'
       pPtr = strrchr(oFile.c_str(), DIR_MARKER);
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/wavoutpmo.cpp:127:10: error: cannot initialize a variable of type 'char *' with an rvalue of type
      'const char *'
   char *pPtr = strrchr(GetUrl().c_str(), DIR_MARKER);
         ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/ZinfTheme.cpp:1768:26: error: assigning to 'char *' from incompatible type 'const char *'
            pExtension = strrchr((*i).c_str(), '.');
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~
    pPtr = strrchr(m_oPath.c_str(), '/');
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
unix/src/cdpmo.cpp:116:10: error: cannot initialize a variable of type 'char *' with an rvalue of
      type 'const char *'
   char *tracknumber = strrchr(url, '/');
         ^             ~~~~~~~~~~~~~~~~~
unix/src/GTKPreferenceWindow.cpp:1755:20: error: cannot initialize a variable of type 'char *' with
      an rvalue of type 'const char *'
             char *name = strrchr((*i).second.c_str(), '/');
                   ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
unix/src/gtkmusicbrowser.cpp:1206:11: error: cannot initialize a variable of type 'char *' with an rvalue of type 'const char *'
    char *ext = strrchr(m_currentListName.c_str(), '.');
          ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
misc.cpp:109:14: error: assigning to 'char *' from incompatible type 'const char *'
        cp = strrchr(url, '.');
             ^~~~~~~~~~~~~~~~~
id3lib.cpp:366:11: error: cannot initialize a variable of type 'char *' with an rvalue of type
      'const char *'
    char *ptr = strrchr(url, '.');
          ^     ~~~~~~~~~~~~~~~~~
id3lib.cpp:426:11: error: assigning to 'char *' from incompatible type 'const char *'
    ptr = strrchr(url, '.');
          ^~~~~~~~~~~~~~~~~
id3lib.cpp:488:11: error: cannot initialize a variable of type 'char *' with an rvalue of type
      'const char *'
    char *ptr = strrchr(url.c_str(), '.');
          ^     ~~~~~~~~~~~~~~~~~~~~~~~~~
vorbis.cpp:151:11: error: assigning to 'char *' from incompatible type 'const char *'
    ptr = strrchr(url, '.');
          ^~~~~~~~~~~~~~~~~

Reported by:	pkg-fallout
This commit is contained in:
Jan Beich 2017-02-03 00:46:44 +00:00
parent d2fe0d850a
commit fabeb6eea8
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=433187
15 changed files with 285 additions and 1 deletions

View file

@ -3,7 +3,7 @@
PORTNAME= zinf
PORTVERSION= 2.2.5
PORTREVISION= 20
PORTREVISION= 21
CATEGORIES= audio ipv6
MASTER_SITES= SF

View file

@ -0,0 +1,38 @@
--- base/src/downloadmanager.cpp.orig 2003-09-16 17:34:53 UTC
+++ base/src/downloadmanager.cpp
@@ -398,7 +398,7 @@ Error DownloadManager::ReadDownloadFile(
{
// find a suitable plugin
result = kError_FormatNotSupported;
- char* extension = strrchr(url, '.');
+ const char* extension = strrchr(url, '.');
if(extension)
{
@@ -558,7 +558,7 @@ static int32_t GetContentLengthFromHeade
{
int32_t result = -1;
- char* cp = strstr(buffer, "Content-Length:");
+ const char* cp = strstr(buffer, "Content-Length:");
if(cp)
{
@@ -572,7 +572,7 @@ static int32_t GetContentLengthFromHeade
static void GetContentTimeFromHeader(const char* buffer, string &mTime)
{
- char* cp = strstr(buffer, "Last-Modified:");
+ const char* cp = strstr(buffer, "Last-Modified:");
if(cp)
{
string::size_type pos;
@@ -748,7 +748,7 @@ Error DownloadManager::Download(Download
struct sockaddr_in addr;
struct hostent host;
SOCKET s = -1;
- char* file = NULL;
+ const char* file = NULL;
bool useProxy;
struct stat st;
string destPath;

View file

@ -0,0 +1,51 @@
--- base/src/player.cpp.orig 2004-02-02 17:39:35 UTC
+++ base/src/player.cpp
@@ -547,7 +547,7 @@ void Player::HandleSingleArg(char *arg)
// who needs to get this, plm or dlm?
bool giveToDLM = false;
bool giveToTheme = false;
- char* extension = NULL;
+ const char* extension = NULL;
extension = strrchr(url.c_str(), '.');
@@ -1103,7 +1103,7 @@ char *
Player::
GetProtocol(const char *title)
{
- char *temp_proto;
+ const char *temp_proto;
char *proto_return = NULL;
temp_proto = strstr(title, "://");
@@ -1122,7 +1122,7 @@ char *
Player::
GetExtension(const char *title)
{
- char *temp_ext;
+ const char *temp_ext;
char *ext_return = NULL;
char *proto = NULL;
@@ -1961,15 +1961,14 @@ HandlePrefsChanged(Event *pEvent)
m_context->prefs->GetPrefString(kProxyHostPref, &buffer);
}
- char *port = strchr(buffer.c_str(),':');
- if (port) {
- *port = '\0';
- port++;
- }
string proxyAddr = buffer;
int nPort = 80;
- if (port && *port)
- nPort = atoi(port);
+ size_t pos = buffer.find(':');
+ if (pos != string::npos) {
+ proxyAddr = buffer.substr(0, pos++);
+ if (pos < buffer.size())
+ nPort = stoi(buffer.substr(pos));
+ }
}

View file

@ -0,0 +1,20 @@
--- base/src/playlist.cpp.orig 2003-09-16 17:58:13 UTC
+++ base/src/playlist.cpp
@@ -1961,7 +1961,7 @@ Error PlaylistManager::ReadPlaylist(cons
{
// find a suitable plugin
result = kError_FormatNotSupported;
- char* extension = strrchr(url, '.');
+ const char* extension = strrchr(url, '.');
if(extension)
{
@@ -2042,7 +2042,7 @@ Error PlaylistManager::WritePlaylist(con
{
// find a suitable plugin
result = kError_FormatNotSupported;
- char* extension = strrchr(url, '.');
+ const char* extension = strrchr(url, '.');
if(extension)
{

View file

@ -0,0 +1,11 @@
--- io/cd/unix/src/cdpmo.cpp.orig 2003-09-16 17:34:59 UTC
+++ io/cd/unix/src/cdpmo.cpp
@@ -113,7 +113,7 @@ Error CDPMO::SetTo(const char *url)
if (IsError(Init(&blah)))
return kError_CDInitFailed;
- char *tracknumber = strrchr(url, '/');
+ const char *tracknumber = strrchr(url, '/');
if (!tracknumber)
tracknumber = (char *)url;

View file

@ -8,3 +8,12 @@
#include <string>
/* project headers */
@@ -124,7 +124,7 @@ Init(OutputInfo* info)
// it, appending an ! to the filename, and changing the extention
// to wav
std::string path;
- char *pPtr = strrchr(GetUrl().c_str(), DIR_MARKER);
+ const char *pPtr = strrchr(GetUrl().c_str(), DIR_MARKER);
if (pPtr){
path = pPtr+1;
pPtr = strrchr(path.c_str(), '.');

View file

@ -16,3 +16,12 @@
#ifdef WIN32
#include <io.h>
@@ -768,7 +768,7 @@ int32_t Http::GetContentLengthFromHeader
{
int32_t result = -1;
- char* cp = strstr(buffer, "Content-Length:");
+ const char* cp = strstr(buffer, "Content-Length:");
if(cp)
{

View file

@ -0,0 +1,29 @@
--- plm/metadata/id3lib/id3lib.cpp.orig 2004-02-14 01:51:03 UTC
+++ plm/metadata/id3lib/id3lib.cpp
@@ -363,7 +363,7 @@ bool ID3lib::ReadMetaData(const char* ur
assert(url);
assert(metadata);
- char *ptr = strrchr(url, '.');
+ const char *ptr = strrchr(url, '.');
if (ptr == NULL)
return false;
@@ -421,7 +421,7 @@ bool ID3lib::WriteMetaData(const char* u
char dummy[20];
bool bWriteID3v1, bWriteID3v2;
luint whichTags;
- char *ptr;
+ const char *ptr;
ptr = strrchr(url, '.');
if (ptr == NULL)
@@ -485,7 +485,7 @@ void ID3lib::LookupGenre(int genreId, ch
bool ID3lib::readMetadata(const std::string&url, map_type& pairs)
{
- char *ptr = strrchr(url.c_str(), '.');
+ const char *ptr = strrchr(url.c_str(), '.');
if (ptr == NULL)
return false;

View file

@ -0,0 +1,34 @@
--- plm/metadata/misc/misc.cpp.orig 2003-09-16 17:35:19 UTC
+++ plm/metadata/misc/misc.cpp
@@ -104,26 +104,11 @@ bool Misc::ReadMetaData(const char* url,
if(!strncasecmp(url, "file://", 7) && !metadata->Time())
{
RegistryItem *lmcItem = NULL;
- char* cp;
-
- cp = strrchr(url, '.');
- if(cp)
- {
- cp++;
-
- char temp[256];
-
- strcpy(temp, cp);
-
- cp = temp;
-
- while(*cp)
- {
- *cp = toupper(*cp);
- cp++;
- }
-
- string ext = temp;
+ const string temp(url);
+ size_t pos = temp.rfind('.');
+ if (pos != string::npos) {
+ string ext = temp.substr(++pos);
+ transform(ext.begin(), ext.end(), ext.begin(), ::toupper);
ExtensionMap::const_iterator iter = m_extensions.find(ext);
if(iter != m_extensions.end())

View file

@ -8,3 +8,33 @@
#include <math.h>
#include <assert.h>
#include <string>
@@ -143,17 +143,18 @@ Vorbis::~Vorbis()
bool Vorbis::WriteMetaData(const char *url, const MetaData & metadata)
{
char dummy[20];
- char *ptr;
bool writetags;
// We will support only id3-like tags. For a more complete list see
// http://reactor-core.org/ogg-tag-standard.html
- ptr = strrchr(url, '.');
+ {
+ const char *ptr = strrchr(url, '.');
if (ptr == NULL)
return false;
if (strcasecmp(ptr, ".ogg"))
return false;
+ }
m_context->prefs->GetPrefBoolean(kWriteVorbisTagsPref, &writetags);
@@ -216,7 +217,7 @@ bool Vorbis::WriteMetaData(const char *u
strncpy(newpath,path.c_str(),path.length());
FILE *out = NULL;
- ptr = strrchr(newpath, '.');
+ char *ptr = strrchr(newpath, '.');
if (ptr)
{
strcpy(ptr, "XXXXXX");

View file

@ -0,0 +1,11 @@
--- ui/musicbrowser/unix/src/gtkmusicbrowser.cpp.orig 2004-02-02 18:34:19 UTC
+++ ui/musicbrowser/unix/src/gtkmusicbrowser.cpp
@@ -1203,7 +1203,7 @@ void GTKMusicBrowser::SaveCurrentPlaylis
if (m_currentListName.length() == 0)
return;
- char *ext = strrchr(m_currentListName.c_str(), '.');
+ const char *ext = strrchr(m_currentListName.c_str(), '.');
if (ext)
ext = ext + 1;
Error result = kError_NoErr;

View file

@ -0,0 +1,11 @@
--- ui/zinf/src/Headlines.cpp.orig 2003-09-16 17:35:32 UTC
+++ ui/zinf/src/Headlines.cpp
@@ -215,7 +215,7 @@ Error Headlines::PCData(string &oData)
Error Headlines::EndElement(string &oElement)
{
- char *pPtr;
+ const char *pPtr;
int iOffset;
pPtr = strrchr(m_oPath.c_str(), '/');

View file

@ -22,3 +22,12 @@
using namespace std;
#include "zlib.h"
@@ -143,7 +143,7 @@ Error ThemeZip::CompressThemeZip(const s
pBuffer = new char[iBufferSize];
for(i = oFileList.begin(); i != oFileList.end(); i++)
{
- char *pPtr;
+ const char *pPtr;
time_t ltime;
oFile = *(*i);

View file

@ -0,0 +1,11 @@
--- ui/zinf/src/ZinfTheme.cpp.orig 2003-09-16 17:36:22 UTC
+++ ui/zinf/src/ZinfTheme.cpp
@@ -1739,7 +1739,7 @@ void ZinfTheme::DropFiles(vector<string>
countbefore = m_pContext->plm->CountItems();
for(i = pFileList->begin(); i != pFileList->end(); i++){
- char *pExtension = NULL;
+ const char *pExtension = NULL;
vector<char*> fileList;
struct _stat st;

View file

@ -0,0 +1,11 @@
--- ui/zinf/unix/src/GTKPreferenceWindow.cpp.orig 2003-11-20 23:58:47 UTC
+++ ui/zinf/unix/src/GTKPreferenceWindow.cpp
@@ -1752,7 +1752,7 @@ void GTKPreferenceWindow::UpdateThemeLis
originalValues.listboxIndex = proposedValues.listboxIndex
= currentValues.listboxIndex = iLoop;
else {
- char *name = strrchr((*i).second.c_str(), '/');
+ const char *name = strrchr((*i).second.c_str(), '/');
if (name) {
name++;
if (name && *name) {