Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 102615 | Differences between
and this patch

Collapse All | Expand All

(-)src/render/rViewport.cpp (-1 / +1 lines)
Lines 163-169 Link Here
163
rViewportConfiguration *rViewportConfiguration::s_viewportConfigurations[]={
163
rViewportConfiguration *rViewportConfiguration::s_viewportConfigurations[]={
164
            &single_vp,&two_vp,&two_b,&three_a,&three_b,&four_vp};
164
            &single_vp,&two_vp,&two_b,&three_a,&three_b,&four_vp};
165
165
166
char *rViewportConfiguration::s_viewportConfigurationNames[]=
166
char const * rViewportConfiguration::s_viewportConfigurationNames[]=
167
    {"$viewport_conf_name_0",
167
    {"$viewport_conf_name_0",
168
     "$viewport_conf_name_1",
168
     "$viewport_conf_name_1",
169
     "$viewport_conf_name_2",
169
     "$viewport_conf_name_2",
(-)src/render/rViewport.h (-1 / +1 lines)
Lines 93-99 Link Here
93
93
94
    static rViewportConfiguration *s_viewportConfigurations[];
94
    static rViewportConfiguration *s_viewportConfigurations[];
95
    static const int               s_viewportNumConfigurations;
95
    static const int               s_viewportNumConfigurations;
96
    static char                   *s_viewportConfigurationNames[];
96
    static char const *            s_viewportConfigurationNames[];
97
97
98
    static rViewportConfiguration *CurrentViewportConfiguration();
98
    static rViewportConfiguration *CurrentViewportConfiguration();
99
99
(-)src/render/rTexture.cpp (-1 / +1 lines)
Lines 765-771 Link Here
765
765
766
int rTextureGroups::TextureMode[rTextureGroups::TEX_GROUPS];
766
int rTextureGroups::TextureMode[rTextureGroups::TEX_GROUPS];
767
767
768
char *rTextureGroups::TextureGroupDescription[rTextureGroups::TEX_GROUPS]=
768
char const * rTextureGroups::TextureGroupDescription[rTextureGroups::TEX_GROUPS]=
769
    {
769
    {
770
        "$texture_mode_0_help",
770
        "$texture_mode_0_help",
771
        "$texture_mode_1_help",
771
        "$texture_mode_1_help",
(-)src/render/rModel.cpp (-1 / +1 lines)
Lines 35-42 Link Here
35
#include "tConfiguration.h"
35
#include "tConfiguration.h"
36
#include "tLocale.h"
36
#include "tLocale.h"
37
#include "rGL.h"
37
#include "rGL.h"
38
#include <string.h>
38
39
39
40
static rModel *sr_ModelAnchor;
40
static rModel *sr_ModelAnchor;
41
41
42
static tConfItem<bool> mod_udl("USE_DISPLAYLISTS", sr_useDisplayLists);
42
static tConfItem<bool> mod_udl("USE_DISPLAYLISTS", sr_useDisplayLists);
(-)src/render/rGLRender.cpp (-1 / +2 lines)
Lines 199-205 Link Here
199
    virtual void MultMatrix(REAL mdata[4][4]){
199
    virtual void MultMatrix(REAL mdata[4][4]){
200
        End(true);
200
        End(true);
201
        tASSERT(sizeof(REAL) == sizeof(GLfloat));
201
        tASSERT(sizeof(REAL) == sizeof(GLfloat));
202
        glMultMatrixf(reinterpret_cast<GLfloat *>(&mdata));
202
	REAL * mdat=&mdata[0][0];
203
        glMultMatrixf(reinterpret_cast<GLfloat *>(mdat));
203
    };
204
    };
204
205
205
    virtual void IdentityMatrix(){
206
    virtual void IdentityMatrix(){
(-)src/render/rTexture.h (-1 / +1 lines)
Lines 49-55 Link Here
49
    };
49
    };
50
50
51
    static int TextureMode[TEX_GROUPS];                 //!< the OpenGL texture modes for the groubs
51
    static int TextureMode[TEX_GROUPS];                 //!< the OpenGL texture modes for the groubs
52
    static char *TextureGroupDescription[TEX_GROUPS];   //!< descriptions for the groups
52
    static char const * TextureGroupDescription[TEX_GROUPS];   //!< descriptions for the groups
53
};
53
};
54
54
55
//! wrapper for SDL surface
55
//! wrapper for SDL surface
(-)src/tron/gMenus.cpp (-3 / +5 lines)
Lines 90-96 Link Here
90
    void NewChoice(uSelectItem<bool> *){};
90
    void NewChoice(uSelectItem<bool> *){};
91
    void NewChoice(char *,bool ){};
91
    void NewChoice(char *,bool ){};
92
public:
92
public:
93
    ArmageTron_feature_menuitem(uMenu *m,char *tit,const char *help,int &targ)
93
    ArmageTron_feature_menuitem(uMenu *m,char const * tit,char const * help,int &targ)
94
            :uMenuItemSelection<int>(m,tit,help,targ){
94
            :uMenuItemSelection<int>(m,tit,help,targ){
95
        uMenuItemSelection<int>::NewChoice(
95
        uMenuItemSelection<int>::NewChoice(
96
            "$feature_disabled_text",
96
            "$feature_disabled_text",
Lines 114-120 Link Here
114
    void NewChoice(uSelectItem<bool> *){};
114
    void NewChoice(uSelectItem<bool> *){};
115
    void NewChoice(char *,bool ){};
115
    void NewChoice(char *,bool ){};
116
public:
116
public:
117
    ArmageTron_texmode_menuitem(uMenu *m,char *tit,int &targ,
117
    ArmageTron_texmode_menuitem(uMenu *m,char const * tit,int &targ,
118
                                bool font=false)
118
                                bool font=false)
119
            :uMenuItemSelection<int>
119
            :uMenuItemSelection<int>
120
    (m,tit,"$texture_menuitem_help",targ){
120
    (m,tit,"$texture_menuitem_help",targ){
Lines 555-562 Link Here
555
static uSelectEntry<rSysDep::rSwapMode> swapMode_60Hz(swapMode,"$swapmode_60hz_text","$swapmode_60hz_help",rSysDep::rSwap_60Hz);
555
static uSelectEntry<rSysDep::rSwapMode> swapMode_60Hz(swapMode,"$swapmode_60hz_text","$swapmode_60hz_help",rSysDep::rSwap_60Hz);
556
*/
556
*/
557
557
558
static tConfItem<int> swapModeCI("SWAP_MODE", reinterpret_cast< int & >( rSysDep::swapMode_ ) );
558
tCONFIG_ENUM( rSysDep::rSwapMode );
559
559
560
static tConfItem< rSysDep::rSwapMode > swapModeCI("SWAP_MODE", rSysDep::swapMode_ );
561
560
static tConfItem<REAL> sgs("SPEED_GAUGE_SIZE",subby_SpeedGaugeSize);
562
static tConfItem<REAL> sgs("SPEED_GAUGE_SIZE",subby_SpeedGaugeSize);
561
static tConfItem<REAL> sgx("SPEED_GAUGE_LOCX",subby_SpeedGaugeLocX);
563
static tConfItem<REAL> sgx("SPEED_GAUGE_LOCX",subby_SpeedGaugeLocX);
562
static tConfItem<REAL> sgy("SPEED_GAUGE_LOCY",subby_SpeedGaugeLocY);
564
static tConfItem<REAL> sgy("SPEED_GAUGE_LOCY",subby_SpeedGaugeLocY);
(-)src/tron/gCycle.cpp (+1 lines)
Lines 52-57 Link Here
52
#include "tMath.h"
52
#include "tMath.h"
53
#include <stdlib.h>
53
#include <stdlib.h>
54
#include <fstream>
54
#include <fstream>
55
#include <memory>
55
56
56
#ifndef DEDICATED
57
#ifndef DEDICATED
57
#define DONTDOIT
58
#define DONTDOIT
(-)src/tron/gGame.cpp (-8 / +8 lines)
Lines 119-125 Link Here
119
static nSettingItemWatched<tString> conf_mapfile("MAP_FILE",mapfile, nConfItemVersionWatcher::Group_Breaking, 8 );
119
static nSettingItemWatched<tString> conf_mapfile("MAP_FILE",mapfile, nConfItemVersionWatcher::Group_Breaking, 8 );
120
120
121
// bool globalingame=false;
121
// bool globalingame=false;
122
tString sg_GetCurrentTime( char *szFormat )
122
tString sg_GetCurrentTime( char const * szFormat )
123
{
123
{
124
    char szTemp[128];
124
    char szTemp[128];
125
    time_t     now;
125
    time_t     now;
Lines 130-136 Link Here
130
    return tString(szTemp);
130
    return tString(szTemp);
131
}
131
}
132
132
133
void sg_PrintCurrentTime( char *szFormat )
133
void sg_PrintCurrentTime( char const * szFormat )
134
{
134
{
135
    con << sg_GetCurrentTime(szFormat);
135
    con << sg_GetCurrentTime(szFormat);
136
}
136
}
Lines 615-621 Link Here
615
protected:
615
protected:
616
    tArray<tString> highName;
616
    tArray<tString> highName;
617
617
618
    char*   highscore_file;
618
    char const * highscore_file;
619
    tOutput desc;
619
    tOutput desc;
620
    int     maxSize;
620
    int     maxSize;
621
621
Lines 728-734 Link Here
728
        return found;
728
        return found;
729
    }
729
    }
730
730
731
    gHighscoresBase(char *name,char *sd,int max=0)
731
    gHighscoresBase(char const * name,char const * sd,int max=0)
732
            :id(-1),highscore_file(name),desc(sd),maxSize(max){
732
            :id(-1),highscore_file(name),desc(sd),maxSize(max){
733
        highscoreList.Add(this,id);
733
        highscoreList.Add(this,id);
734
    }
734
    }
Lines 935-941 Link Here
935
        }
935
        }
936
    }
936
    }
937
937
938
    highscores(char *name,char *sd,int max=0)
938
    highscores(char const * name,char const * sd,int max=0)
939
            :gHighscoresBase(name,sd,max){
939
            :gHighscoresBase(name,sd,max){
940
        //		Load();
940
        //		Load();
941
    }
941
    }
Lines 1145-1151 Link Here
1145
        }
1145
        }
1146
    }
1146
    }
1147
1147
1148
    ladder(char *name,char *sd,int max=0)
1148
    ladder(char const * name,char const * sd,int max=0)
1149
            :highscores<REAL>(name,sd,max){
1149
            :highscores<REAL>(name,sd,max){
1150
        //		Load();
1150
        //		Load();
1151
    }
1151
    }
Lines 2323-2329 Link Here
2323
    if (ingame)
2323
    if (ingame)
2324
        sg_IngameMenu = &MainMenu;
2324
        sg_IngameMenu = &MainMenu;
2325
2325
2326
    char *extitle,*exhelp;
2326
    char const * extitle,* exhelp;
2327
    if (!ingame){
2327
    if (!ingame){
2328
        extitle="$main_menu_exit_text";
2328
        extitle="$main_menu_exit_text";
2329
        exhelp="$main_menu_exit_help";
2329
        exhelp="$main_menu_exit_help";
Lines 2439-2445 Link Here
2439
    uMenuItemSubmenu *gamemenuitem = NULL;
2439
    uMenuItemSubmenu *gamemenuitem = NULL;
2440
    if (sn_GetNetState() != nCLIENT)
2440
    if (sn_GetNetState() != nCLIENT)
2441
    {
2441
    {
2442
        char *gamehelp;
2442
        char const * gamehelp;
2443
        if (!ingame)
2443
        if (!ingame)
2444
            gamehelp="$game_menu_main_help";
2444
            gamehelp="$game_menu_main_help";
2445
        else
2445
        else
(-)src/tron/gAIBase.cpp (+2 lines)
Lines 43-48 Link Here
43
#include "tRandom.h"
43
#include "tRandom.h"
44
#include "tRecorder.h"
44
#include "tRecorder.h"
45
#include <stdlib.h>
45
#include <stdlib.h>
46
#include <cstdlib>
47
#include <memory>
46
48
47
#define AI_REACTION          0 
49
#define AI_REACTION          0 
48
#define AI_EMERGENCY         1 
50
#define AI_EMERGENCY         1 
(-)src/tron/gArmagetron.cpp (-3 / +32 lines)
Lines 455-460 Link Here
455
455
456
static const char * dedicatedSection = "DEDICATED";
456
static const char * dedicatedSection = "DEDICATED";
457
457
458
class gAutoStringArray
459
{
460
public:
461
    ~gAutoStringArray()
462
    {
463
        for ( std::vector< char * >::iterator i = strings.begin(); i != strings.end(); ++i )
464
        {
465
            free( *i );
466
        }
467
    }
468
469
    char * Store( char const * s )
470
    {
471
        char * ret = strdup( s );
472
        strings.push_back( ret );
473
        return ret;
474
    }
475
private:
476
    std::vector< char * > strings; // the stored raw C strings
477
};
478
479
// wrapper for putenv, taking care of the peculiarity that the argument
480
// is kept in use for the rest of the program's lifetime
481
void sg_PutEnv( char const * s )
482
{
483
    static gAutoStringArray store;
484
    putenv( store.Store( s ) );
485
}
486
458
int main(int argc,char **argv){
487
int main(int argc,char **argv){
459
    //std::cout << "enter\n";
488
    //std::cout << "enter\n";
460
    //  net_test();
489
    //  net_test();
Lines 561-574 Link Here
561
		#ifdef linux
590
		#ifdef linux
562
            // Sam 5/23 - Don't ever use DGA, we don't need it for this game.
591
            // Sam 5/23 - Don't ever use DGA, we don't need it for this game.
563
            if ( ! getenv("SDL_VIDEO_X11_DGAMOUSE") ) {
592
            if ( ! getenv("SDL_VIDEO_X11_DGAMOUSE") ) {
564
                putenv("SDL_VIDEO_X11_DGAMOUSE=0");
593
                sg_PutEnv( "SDL_VIDEO_X11_DGAMOUSE=0" );
565
            }
594
            }
566
		#endif
595
		#endif
567
596
568
		#ifdef WIN32
597
		#ifdef WIN32
569
            // disable DirectX by default; it causes problems with some boards.
598
            // disable DirectX by default; it causes problems with some boards.
570
            if (!use_directx && !getenv("SDL_VIDEODRIVER") ) {
599
            if (!use_directx && !getenv( "SDL_VIDEODRIVER") ) {
571
                putenv("SDL_VIDEODRIVER=windib");
600
                sg_PutEnv( "SDL_VIDEODRIVER=windib" );
572
            }
601
            }
573
		#endif
602
		#endif
574
603
(-)src/tron/gServerBrowser.cpp (-2 / +3 lines)
Lines 57-63 Link Here
57
static tOutput *sg_StartHelpText = NULL;
57
static tOutput *sg_StartHelpText = NULL;
58
58
59
nServerInfo::QueryType sg_queryType = nServerInfo::QUERY_OPTOUT;
59
nServerInfo::QueryType sg_queryType = nServerInfo::QUERY_OPTOUT;
60
static tSettingItem< int > sg_query_type( "BROWSER_QUERY_FILTER", reinterpret_cast< int & >( sg_queryType ) );
60
tCONFIG_ENUM( nServerInfo::QueryType );
61
static tSettingItem< nServerInfo::QueryType > sg_query_type( "BROWSER_QUERY_FILTER", sg_queryType );
61
62
62
class gServerMenuItem;
63
class gServerMenuItem;
63
64
Lines 773-779 Link Here
773
    return server;
774
    return server;
774
}
775
}
775
776
776
static char *sg_HelpText = "$network_master_browserhelp";
777
static char const * sg_HelpText = "$network_master_browserhelp";
777
778
778
gServerMenuItem::gServerMenuItem(gServerMenu *men)
779
gServerMenuItem::gServerMenuItem(gServerMenu *men)
779
        :gBrowserMenuItem(men, sg_HelpText), server(NULL), lastPing_(-100), favorite_(false)
780
        :gBrowserMenuItem(men, sg_HelpText), server(NULL), lastPing_(-100), favorite_(false)
(-)src/network/nNetObject.h (-1 / +2 lines)
Lines 31-36 Link Here
31
#include "nNetwork.h"
31
#include "nNetwork.h"
32
#include "tArray.h"
32
#include "tArray.h"
33
#include "tConsole.h"
33
#include "tConsole.h"
34
#include <string.h>
34
35
35
class nObserver;
36
class nObserver;
36
37
Lines 77-83 Link Here
77
    bool nextSyncAck:1;         // should the next sync message wait
78
    bool nextSyncAck:1;         // should the next sync message wait
78
        // for it's ack?
79
        // for it's ack?
79
    bool syncReq:1;              // should a sync message be sent?
80
    bool syncReq:1;              // should a sync message be sent?
80
    int  acksPending:4;          // how many messages are underway?
81
    unsigned int acksPending:4;  // how many messages are underway?
81
82
82
        nKnowsAboutInfo(){
83
        nKnowsAboutInfo(){
83
            memset(this, 0, sizeof(nKnowsAboutInfo) );
84
            memset(this, 0, sizeof(nKnowsAboutInfo) );
(-)src/network/nSocket.cpp (+1 lines)
Lines 38-43 Link Here
38
38
39
#include <string>
39
#include <string>
40
#include <stdio.h>
40
#include <stdio.h>
41
#include <string.h>
41
42
42
#include <sys/types.h>
43
#include <sys/types.h>
43
44
(-)src/network/nNetwork.cpp (-15 / +19 lines)
Lines 20-26 Link Here
20
You should have received a copy of the GNU General Public License
20
You should have received a copy of the GNU General Public License
21
along with this program; if not, write to the Free Software
21
along with this program; if not, write to the Free Software
22
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
22
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
23
  
23
24
***************************************************************************
24
***************************************************************************
25
25
26
*/
26
*/
Lines 40-45 Link Here
40
#include <stdlib.h>
40
#include <stdlib.h>
41
#include <fstream>
41
#include <fstream>
42
#include "tMath.h"
42
#include "tMath.h"
43
#include <string.h>
43
44
44
#ifndef WIN32
45
#ifndef WIN32
45
#include  <netinet/in.h>
46
#include  <netinet/in.h>
Lines 600-606 Link Here
600
    if (message->Descriptor()!=s_Acknowledge.ID())
601
    if (message->Descriptor()!=s_Acknowledge.ID())
601
        sn_Connections[receiver].ackPending++;
602
        sn_Connections[receiver].ackPending++;
602
    else
603
    else
603
        tASSERT(false);
604
        tERR_ERROR("Should not wait for ack of an ack message itself.");
605
604
    //    sn_ackAckPending[receiver]++;
606
    //    sn_ackAckPending[receiver]++;
605
#ifdef NET_DEBUG
607
#ifdef NET_DEBUG
606
    acks++;
608
    acks++;
Lines 646-652 Link Here
646
        sn_Connections[receiver].ReliableMessageSent();
648
        sn_Connections[receiver].ReliableMessageSent();
647
    }
649
    }
648
    else
650
    else
649
        tASSERT(false);
651
    {
652
        tERR_ERROR( "No message." );
653
    }
650
    //    sn_ackAckPending[receiver]--;
654
    //    sn_ackAckPending[receiver]--;
651
655
652
    sn_pendingAcks.Remove(this,id);
656
    sn_pendingAcks.Remove(this,id);
Lines 1146-1152 Link Here
1146
      Read((unsigned short &)vorkomma);
1150
      Read((unsigned short &)vorkomma);
1147
      Read(nachkomma);
1151
      Read(nachkomma);
1148
      x=vorkomma+nachkomma/60000.0;
1152
      x=vorkomma+nachkomma/60000.0;
1149
     
1153
1150
      Read(((unsigned short *)&x)[0]);
1154
      Read(((unsigned short *)&x)[0]);
1151
      Read(((unsigned short *)&x)[1]);
1155
      Read(((unsigned short *)&x)[1]);
1152
     */
1156
     */
Lines 1322-1328 Link Here
1322
          lo->Send(0);
1326
          lo->Send(0);
1323
1327
1324
          sn_Sync(10);
1328
          sn_Sync(10);
1325
          
1329
1326
          (new nMessage(login))->Send(0);
1330
          (new nMessage(login))->Send(0);
1327
        */
1331
        */
1328
    }
1332
    }
Lines 1891-1897 Link Here
1891
        return;
1895
        return;
1892
    }
1896
    }
1893
1897
1894
#ifdef DEBUG  
1898
#ifdef DEBUG
1895
    /*
1899
    /*
1896
    if (descriptor>1)
1900
    if (descriptor>1)
1897
      con << "SMT " << descriptor << "\n";
1901
      con << "SMT " << descriptor << "\n";
Lines 1930-1952 Link Here
1930
        /*
1934
        /*
1931
          if (sn_Connections[].rate_control[peer]>0)
1935
          if (sn_Connections[].rate_control[peer]>0)
1932
          send_collected(peer);
1936
          send_collected(peer);
1933
            
1937
1934
          unsigned short *b=new (unsigned short)[data.Len()+3];
1938
          unsigned short *b=new (unsigned short)[data.Len()+3];
1935
            
1939
1936
          b[0]=htons(descriptor);
1940
          b[0]=htons(descriptor);
1937
          b[1]=htons(messageID);
1941
          b[1]=htons(messageID);
1938
          b[2]=htons(data.Len());
1942
          b[2]=htons(data.Len());
1939
          int len=data.Len();
1943
          int len=data.Len();
1940
          for(int i=0;i<len;i++)
1944
          for(int i=0;i<len;i++)
1941
          b[3+i]=htons(data(i));
1945
          b[3+i]=htons(data(i));
1942
            
1946
1943
            
1947
1944
          ANET_Write(sn_Connections[].socket[peer],(int8 *)b,
1948
          ANET_Write(sn_Connections[].socket[peer],(int8 *)b,
1945
          2*(data.Len()+3),&peers[peer]);
1949
          2*(data.Len()+3),&peers[peer]);
1946
            
1950
1947
          //std::cerr << "Sent " << 2*len+6 << " bytes.\n";
1951
          //std::cerr << "Sent " << 2*len+6 << " bytes.\n";
1948
          sn_Connections[].rate_control[peer]-=2*(len+3)+OVERHEAD;
1952
          sn_Connections[].rate_control[peer]-=2*(len+3)+OVERHEAD;
1949
            
1953
1950
          delete b;
1954
          delete b;
1951
        */
1955
        */
1952
1956
Lines 2023-2030 Link Here
2023
    // the growing buffer we read messages into
2027
    // the growing buffer we read messages into
2024
    const int serverMaxAcceptedSize=2000;
2028
    const int serverMaxAcceptedSize=2000;
2025
    static tArray< unsigned short > storage(2000);
2029
    static tArray< unsigned short > storage(2000);
2026
    int maxrec = storage.Len();
2030
    int maxrec = 0; maxrec = storage.Len();
2027
    unsigned short * buff = &storage[0];
2031
    unsigned short * buff = 0; buff = &storage[0];
2028
2032
2029
    // short buff[maxrec];
2033
    // short buff[maxrec];
2030
    if (sn_Connections[peer].socket){
2034
    if (sn_Connections[peer].socket){
Lines 2380-2386 Link Here
2380
                sn_Listen( net_hostport, tString( "ANY" ) ) ||         // second try: bind to generic IP
2384
                sn_Listen( net_hostport, tString( "ANY" ) ) ||         // second try: bind to generic IP
2381
                sn_Listen( net_hostport, tString( "ALL" ) );           // last try: bind to all available IPs
2385
                sn_Listen( net_hostport, tString( "ALL" ) );           // last try: bind to all available IPs
2382
2386
2383
#ifdef DEDICATED                
2387
#ifdef DEDICATED
2384
                // save host port that worked, otherwise it may change from the port sent to the master server
2388
                // save host port that worked, otherwise it may change from the port sent to the master server
2385
                sn_serverPort = net_hostport;
2389
                sn_serverPort = net_hostport;
2386
#endif
2390
#endif
(-)src/network/nKrawall.cpp (+1 lines)
Lines 44-49 Link Here
44
44
45
#include <stdlib.h>
45
#include <stdlib.h>
46
#include <string>
46
#include <string>
47
#include <string.h>
47
48
48
bool nKrawall::MayRequirePassword(tString& adress, unsigned int port)
49
bool nKrawall::MayRequirePassword(tString& adress, unsigned int port)
49
{
50
{
(-)src/network/nNetwork.h (+1 lines)
Lines 36-41 Link Here
36
#include "nObserver.h"
36
#include "nObserver.h"
37
//#include "tCrypt.h"
37
//#include "tCrypt.h"
38
#include "tException.h"
38
#include "tException.h"
39
#include <memory>
39
40
40
class nSocket;
41
class nSocket;
41
class nAddress;
42
class nAddress;
(-)src/network/nAuthentification.cpp (+1 lines)
Lines 35-40 Link Here
35
35
36
#include <memory>
36
#include <memory>
37
#include <string>
37
#include <string>
38
#include <string.h>
38
39
39
static nAuthentification::UserPasswordCallback* S_UserPasswordCallback = NULL;
40
static nAuthentification::UserPasswordCallback* S_UserPasswordCallback = NULL;
40
static nAuthentification::LoginResultCallback*  S_LoginResultCallback  = NULL;
41
static nAuthentification::LoginResultCallback*  S_LoginResultCallback  = NULL;
(-)src/network/nConfig.cpp (-11 / +12 lines)
Lines 30-35 Link Here
30
#include "tConsole.h"
30
#include "tConsole.h"
31
#include "tSysTime.h"
31
#include "tSysTime.h"
32
#include <set>
32
#include <set>
33
#include <string.h>
33
34
34
nConfItemBase::nConfItemBase()
35
nConfItemBase::nConfItemBase()
35
        :tConfItemBase(""), lastChangeTime_(-10000), lastChangeMessage_(0), watcher_(0){}
36
        :tConfItemBase(""), lastChangeTime_(-10000), lastChangeMessage_(0), watcher_(0){}
Lines 377-383 Link Here
377
        , reverted_( false )
378
        , reverted_( false )
378
        , group_( c )
379
        , group_( c )
379
        , overrideGroupBehavior_( Behavior_Default )
380
        , overrideGroupBehavior_( Behavior_Default )
380
        , overrideGroupBehaviorConf_( item.GetTitle() + "_OVERRIDE", reinterpret_cast< int & >( overrideGroupBehavior_ ) )
381
        , overrideGroupBehaviorConf_( item.GetTitle() + "_OVERRIDE", overrideGroupBehavior_ )
381
{
382
{
382
    sn_StrongWatchersAddRef();
383
    sn_StrongWatchersAddRef();
383
    sn_GetStrongWatchers().insert(this);
384
    sn_GetStrongWatchers().insert(this);
Lines 587-604 Link Here
587
588
588
static nConfItemVersionWatcher::Behavior sn_GroupBehaviors[ nConfItemVersionWatcher::Group_Max ] =
589
static nConfItemVersionWatcher::Behavior sn_GroupBehaviors[ nConfItemVersionWatcher::Group_Max ] =
589
    {
590
    {
590
        nConfItemVersionWatcher::Behavior_Block,
591
        Behavior_Block,
591
        nConfItemVersionWatcher::Behavior_Block,
592
        Behavior_Block,
592
        nConfItemVersionWatcher::Behavior_Nothing,
593
        Behavior_Nothing,
593
        nConfItemVersionWatcher::Behavior_Block,
594
        Behavior_Block,
594
        nConfItemVersionWatcher::Behavior_Nothing,
595
        Behavior_Nothing,
595
    };
596
    };
596
597
597
static tSettingItem< int > sn_GroupBehaviorBreaks( "SETTING_LEGACY_BEHAVIOR_BREAKING", reinterpret_cast< int & >( sn_GroupBehaviors[ nConfItemVersionWatcher::Group_Breaking] ) );
598
static tSettingItem< nConfItemVersionWatcher::Behavior > sn_GroupBehaviorBreaks( "SETTING_LEGACY_BEHAVIOR_BREAKING", sn_GroupBehaviors[ nConfItemVersionWatcher::Group_Breaking] );
598
static tSettingItem< int > sn_GroupBehaviorBumpy( "SETTING_LEGACY_BEHAVIOR_BUMPY", reinterpret_cast< int & >( sn_GroupBehaviors[ nConfItemVersionWatcher::Group_Bumpy] ) );
599
static tSettingItem< nConfItemVersionWatcher::Behavior > sn_GroupBehaviorBumpy( "SETTING_LEGACY_BEHAVIOR_BUMPY", sn_GroupBehaviors[ nConfItemVersionWatcher::Group_Bumpy] );
599
static tSettingItem< int > sn_GroupBehaviorAnnoyance( "SETTING_LEGACY_BEHAVIOR_ANNOYING", reinterpret_cast< int & >( sn_GroupBehaviors[ nConfItemVersionWatcher::Group_Annoying] ) );
600
static tSettingItem< nConfItemVersionWatcher::Behavior > sn_GroupBehaviorAnnoyance( "SETTING_LEGACY_BEHAVIOR_ANNOYING", sn_GroupBehaviors[ nConfItemVersionWatcher::Group_Annoying] );
600
static tSettingItem< int > sn_GroupBehaviorCheat( "SETTING_LEGACY_BEHAVIOR_CHEATING", reinterpret_cast< int & >( sn_GroupBehaviors[ nConfItemVersionWatcher::Group_Cheating] ) );
601
static tSettingItem< nConfItemVersionWatcher::Behavior > sn_GroupBehaviorCheat( "SETTING_LEGACY_BEHAVIOR_CHEATING", sn_GroupBehaviors[ nConfItemVersionWatcher::Group_Cheating] );
601
static tSettingItem< int > sn_GroupBehaviorDisplay( "SETTING_LEGACY_BEHAVIOR_VISUAL", reinterpret_cast< int & >( sn_GroupBehaviors[ nConfItemVersionWatcher::Group_Visual] ) );
602
static tSettingItem< nConfItemVersionWatcher::Behavior > sn_GroupBehaviorDisplay( "SETTING_LEGACY_BEHAVIOR_VISUAL", sn_GroupBehaviors[ nConfItemVersionWatcher::Group_Visual] );
602
603
603
// *******************************************************************************************
604
// *******************************************************************************************
604
// *
605
// *
(-)src/network/md5.cpp (+1 lines)
Lines 78-83 Link Here
78
78
79
#include <string>
79
#include <string>
80
#include <memory>
80
#include <memory>
81
#include <string.h>
81
82
82
#ifdef TEST
83
#ifdef TEST
83
/*
84
/*
(-)src/network/nConfig.h (-9 / +14 lines)
Lines 210-215 Link Here
210
    virtual void ReadVal(std::istream &s);
210
    virtual void ReadVal(std::istream &s);
211
};
211
};
212
212
213
//! how we react on a client with a version incompatible with a setting
214
enum nConfigItemBehavior
215
{
216
    Behavior_Nothing = 0, //!< do nothing, let client on
217
    Behavior_Revert = 1,  //!< revert setting to default value
218
    Behavior_Block = 2,   //!< don't let the client play at all
219
    Behavior_Default = 3  //!< do whatever someone else says
220
};
221
222
class nConfItemVersionWatcher;
223
tCONFIG_ENUM( nConfigItemBehavior );
224
213
//! configuration item watcher that shuts out clients that don't support a certain interface
225
//! configuration item watcher that shuts out clients that don't support a certain interface
214
class nConfItemVersionWatcher: public nIConfItemWatcher
226
class nConfItemVersionWatcher: public nIConfItemWatcher
215
{
227
{
Lines 226-239 Link Here
226
        Group_Max
238
        Group_Max
227
    };
239
    };
228
240
229
    //! how we react on a client with a version incompatible with a setting
241
    typedef nConfigItemBehavior Behavior;
230
    enum Behavior
231
    {
232
        Behavior_Nothing = 0, //!< do nothing, let client on
233
        Behavior_Revert = 1,  //!< revert setting to default value
234
        Behavior_Block = 2,   //!< don't let the client play at all
235
        Behavior_Default = 3  //!< do whatever someone else says
236
    };
237
242
238
    nConfItemVersionWatcher( nConfItemBase & item, Group group, int min, int max = -1 );          //!< constructor
243
    nConfItemVersionWatcher( nConfItemBase & item, Group group, int min, int max = -1 );          //!< constructor
239
    virtual ~nConfItemVersionWatcher();                      //!< destructor
244
    virtual ~nConfItemVersionWatcher();                      //!< destructor
Lines 255-261 Link Here
255
260
256
    Group group_;                                            //!< class of incompatibility
261
    Group group_;                                            //!< class of incompatibility
257
    Behavior overrideGroupBehavior_;                         //!< if set, the global behavior for the class gets ignored
262
    Behavior overrideGroupBehavior_;                         //!< if set, the global behavior for the class gets ignored
258
    tSettingItem< int > overrideGroupBehaviorConf_;          //!< setting item for override
263
    tSettingItem< Behavior > overrideGroupBehaviorConf_;     //!< setting item for override
259
};
264
};
260
265
261
//! convenience helper class: setting item and version watcher combined
266
//! convenience helper class: setting item and version watcher combined
(-)src/tools/tArray.cpp (+1 lines)
Lines 33-38 Link Here
33
#include <stdlib.h>
33
#include <stdlib.h>
34
#include <string>
34
#include <string>
35
#include "tArray.h"
35
#include "tArray.h"
36
#include <string.h>
36
37
37
void GrowingArrayBase::ComplainIfFull(){
38
void GrowingArrayBase::ComplainIfFull(){
38
    if (Len()>0)
39
    if (Len()>0)
(-)src/tools/tError.cpp (+2 lines)
Lines 27-32 Link Here
27
27
28
#include "config.h"
28
#include "config.h"
29
#include <iostream>
29
#include <iostream>
30
#include <string.h>
31
#include <cstdlib>
30
#if HAVE_UNISTD_H
32
#if HAVE_UNISTD_H
31
#include <unistd.h>
33
#include <unistd.h>
32
#endif
34
#endif
(-)src/tools/tCommandLine.h (-2 / +2 lines)
Lines 62-69 Link Here
62
struct tCommandLineParser
62
struct tCommandLineParser
63
{
63
{
64
public:
64
public:
65
    bool GetSwitch( char const * option, char * option_short=NULL );                      //! Tests whether the current argument is the given switch
65
    bool GetSwitch( char const * option, char const * option_short=NULL );                      //! Tests whether the current argument is the given switch
66
    bool GetOption( tString & target, char const * option, char * option_short=NULL );    //! Tests whether the current argument is the given option and extracts the value
66
    bool GetOption( tString & target, char const * option, char const * option_short=NULL );    //! Tests whether the current argument is the given option and extracts the value
67
67
68
    bool End() const;                                                                     //! Tests whether the command line parsing is done
68
    bool End() const;                                                                     //! Tests whether the command line parsing is done
69
69
(-)src/tools/tConfiguration.cpp (+1 lines)
Lines 42-47 Link Here
42
#include "tCommandLine.h"
42
#include "tCommandLine.h"
43
43
44
#include <vector>
44
#include <vector>
45
#include <string.h>
45
46
46
/***********************************************************************
47
/***********************************************************************
47
 * The new Configuration interface, currently not completely implemented
48
 * The new Configuration interface, currently not completely implemented
(-)src/tools/tMemManager.cpp (-1 / +1 lines)
Lines 197-203 Link Here
197
#endif
197
#endif
198
198
199
199
200
static char *leakname="leak.log";
200
static char const *leakname="leak.log";
201
static bool checkleaks=true;
201
static bool checkleaks=true;
202
static const char *fileName="XXX";
202
static const char *fileName="XXX";
203
static const char *classname="XXX";
203
static const char *classname="XXX";
(-)src/tools/tRandom.cpp (+1 lines)
Lines 36-41 Link Here
36
36
37
#include    "tError.h"
37
#include    "tError.h"
38
#include    "tRecorder.h"
38
#include    "tRecorder.h"
39
#include    <cstdlib>
39
40
40
#undef 	INLINE_DEF
41
#undef 	INLINE_DEF
41
#define INLINE_DEF
42
#define INLINE_DEF
(-)src/tools/tCommandLine.cpp (-2 / +2 lines)
Lines 219-225 Link Here
219
//!
219
//!
220
// *******************************************************************************************
220
// *******************************************************************************************
221
221
222
bool tCommandLineParser::GetSwitch( char const * option, char * option_short )
222
bool tCommandLineParser::GetSwitch( char const * option, char const * option_short )
223
{
223
{
224
    if ( End() )
224
    if ( End() )
225
        return false;
225
        return false;
Lines 248-254 Link Here
248
//!
248
//!
249
// *******************************************************************************************
249
// *******************************************************************************************
250
250
251
bool tCommandLineParser::GetOption( tString & target, char const * option, char * option_short )
251
bool tCommandLineParser::GetOption( tString & target, char const * option, char const * option_short )
252
{
252
{
253
    if ( End() )
253
    if ( End() )
254
        return false;
254
        return false;
(-)src/tools/tError.h (-3 / +4 lines)
Lines 36-46 Link Here
36
#include <sstream>
36
#include <sstream>
37
#include <iosfwd>
37
#include <iosfwd>
38
#include <string>
38
#include <string>
39
#include <string.h>
39
#if HAVE_UNISTD_H
40
#if HAVE_UNISTD_H
40
#include <unistd.h>
41
#include <unistd.h>
41
#endif
42
#endif
42
43
43
#define tVERIFY( x ) { if ( !( x ) ){ char* mess = "Assertion " #x " failed";  tERR_ERROR_INT( mess ); } }
44
#define tVERIFY( x ) { if ( !( x ) ){ char const * mess = "Assertion " #x " failed";  tERR_ERROR_INT( mess ); } }
44
45
45
#ifdef DEBUG
46
#ifdef DEBUG
46
47
Lines 60-68 Link Here
60
61
61
#define tERR_FLOW_LOW() if(st_debugValid(very_low,flow)) std::cout  <<  std::setw(30) << __PRETTY_FUNCTION__  << '\n'
62
#define tERR_FLOW_LOW() if(st_debugValid(very_low,flow)) std::cout  <<  std::setw(30) << __PRETTY_FUNCTION__  << '\n'
62
63
63
#define tASSERT( x ) { if ( !( x ) ){ char* mess = "Assertion " #x " failed";  tERR_ERROR_INT( mess ); } }
64
#define tASSERT( x ) { if ( !( x ) ){ char const * mess = "Assertion " #x " failed";  tERR_ERROR_INT( mess ); } }
64
65
65
#define tASSERT_EVAL( x ) { if ( !( x ) ){ char* mess = "Assertion " #x " failed";  tERR_ERROR_INT( mess ); } }
66
#define tASSERT_EVAL( x ) { if ( !( x ) ){ char const * mess = "Assertion " #x " failed";  tERR_ERROR_INT( mess ); } }
66
67
67
#else  /* DEBUG */
68
#else  /* DEBUG */
68
#define tERR_DUMP(level,stream,stuff) 
69
#define tERR_DUMP(level,stream,stuff) 
(-)src/tools/tCrypt.cpp (+1 lines)
Lines 29-34 Link Here
29
#include "tMemManager.h"
29
#include "tMemManager.h"
30
30
31
#include <string>
31
#include <string>
32
#include <string.h>
32
33
33
class tCryptDummy: public tCrypt
34
class tCryptDummy: public tCrypt
34
{
35
{
(-)src/engine/ePlayer.cpp (-1 / +1 lines)
Lines 497-503 Link Here
497
497
498
498
499
499
500
static char *default_instant_chat[]=
500
static char const * default_instant_chat[]=
501
    {"/team \\",
501
    {"/team \\",
502
     "/msg \\",
502
     "/msg \\",
503
     "/me \\",
503
     "/me \\",
(-)src/engine/eTeam.cpp (-1 / +1 lines)
Lines 45-51 Link Here
45
      {  7,  7,  7 }   // black
45
      {  7,  7,  7 }   // black
46
    };
46
    };
47
47
48
static char* se_team_name[TEAMCOLORS]=
48
static char const * se_team_name[TEAMCOLORS]=
49
    {
49
    {
50
        "$team_name_blue",
50
        "$team_name_blue",
51
        "$team_name_gold",
51
        "$team_name_gold",
(-)src/defs.h (+9 lines)
Lines 39-44 Link Here
39
#include <math.h>
39
#include <math.h>
40
#include <iosfwd>
40
#include <iosfwd>
41
41
42
// Includes required for GCC 4.3 only. Remove them as soon as some of 
43
// us developers have GCC 4.3, then it is of course better to only put them
44
// where they are needed.
45
#include <string.h>
46
#include <memory>
47
#include <typeinfo>
48
#include <cstdlib>
49
// end of GCC 4.3 includes
50
42
// maximum number of supported viewports
51
// maximum number of supported viewports
43
#ifndef MAX_VIEWERS
52
#ifndef MAX_VIEWERS
44
#define MAX_VIEWERS 4
53
#define MAX_VIEWERS 4
(-)src/ui/uInput.cpp (-2 / +2 lines)
Lines 344-350 Link Here
344
//  Menuitem for input selection
344
//  Menuitem for input selection
345
// *****************************************************
345
// *****************************************************
346
346
347
static char *keyname(int sym){
347
static char const * keyname(int sym){
348
#ifndef DEDICATED
348
#ifndef DEDICATED
349
    if (sym<=SDLK_LAST)
349
    if (sym<=SDLK_LAST)
350
        return SDL_GetKeyName(static_cast<SDLKey>(sym));
350
        return SDL_GetKeyName(static_cast<SDLKey>(sym));
Lines 716-722 Link Here
716
// Player binds
716
// Player binds
717
// *****************
717
// *****************
718
718
719
static char *Player_keyword="PLAYER_BIND";
719
static char const * Player_keyword="PLAYER_BIND";
720
720
721
uBindPlayer::uBindPlayer(uAction *a,int p):uBind(a),ePlayer(p){}
721
uBindPlayer::uBindPlayer(uAction *a,int p):uBind(a),ePlayer(p){}
722
722
(-)accustomdir.m4 (-1 / +6 lines)
Lines 3-8 Link Here
3
m4_define([_m4_divert(PARSE_ARGS_MOREOPTS)], 19)
3
m4_define([_m4_divert(PARSE_ARGS_MOREOPTS)], 19)
4
#m4_define([_m4_divert(PARSE_ARGS)],      20)
4
#m4_define([_m4_divert(PARSE_ARGS)],      20)
5
5
6
# old versions of autoconf define _AC_SRCPATHS, new (2.60 and later) use _AC_SRCDIRS.
7
# map the old macro to the new one.
8
m4_pattern_allow([_AC_SRCDIRS])
9
m4_ifdef([_AC_SRCDIRS],,[m4_define([_AC_SRCDIRS],[_AC_SRCPATHS([$1])])])
10
6
# _AC_INIT_PARSE_ARGS
11
# _AC_INIT_PARSE_ARGS
7
# -------------------
12
# -------------------
8
m4_define([_AC_INIT_PARSE_ARGS],
13
m4_define([_AC_INIT_PARSE_ARGS],
Lines 549-555 Link Here
549
  ac_popdir=`pwd`
554
  ac_popdir=`pwd`
550
  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
555
  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
551
    test -d $ac_dir || continue
556
    test -d $ac_dir || continue
552
    _AC_SRCPATHS(["$ac_dir"])
557
    _AC_SRCDIRS(["$ac_dir"])
553
    cd $ac_dir
558
    cd $ac_dir
554
    # Check for guested configure; otherwise get Cygnus style configure.
559
    # Check for guested configure; otherwise get Cygnus style configure.
555
    if test -f $ac_srcdir/configure.gnu; then
560
    if test -f $ac_srcdir/configure.gnu; then

Return to bug 102615