Çözüldü Shop Search Warning

  • Konuyu açan Konuyu açan MEKA
  • Açılış Tarihi Açılış Tarihi
  • Yanıt Yanıt 16
  • Gösterim Gösterim 1K
Bu konu çözüme ulaştırılmıştır. Çözüm için konuya yazılan tüm yorumları okumayı unutmayın. Eğer konudaki yorumlar sorununuzu çözmediyse yeni bir konu açabilirsiniz.
Durum
İçerik kilitlendiği için mesaj gönderimine kapatıldı.

MEKA

Discord: mekaprojects
Süper Moderatör
Grafiker
Geliştirici
Yardımsever Üye
Mesaj
2.852
Çözümler
297
Beğeni
2.134
Puan
1.850
Ticaret Puanı
2
1313131.webp


Böyle bir warning alıyorum bu warningi nasıl çözebilirim ?

Warning veren kod blogu
C++:
Genişlet Daralt Kopyala
#ifdef ENABLE_CHEQUE_SYSTEM
void CHARACTER::ShopSearchInfo(bool bNameOnly, BYTE bJob, BYTE bItemType, BYTE bItemSubType, BYTE bMinLevel, BYTE bMaxLevel, BYTE bMinRefine, BYTE bMaxRefine, long lMinGold, long lMaxGold, BYTE bMinCheque, BYTE bMaxCheque, const char* c_szItemName)
#else
void CHARACTER::ShopSearchInfo(bool bNameOnly, BYTE bJob, BYTE bItemType, BYTE bItemSubType, BYTE bMinLevel, BYTE bMaxLevel, BYTE bMinRefine, BYTE bMaxRefine, long lMinGold, long lMaxGold, const char* c_szItemName)
#endif
{
    if (!IsPC() || IsDead())
        return;

    if (IsOpenSafebox() || GetShop() || IsCubeOpen() || IsDead() || GetExchange() || GetOfflineShop() || GetMyShop())
    {
        ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Acik olan pecereleri kapatmalisin."));
        return;
    }

    if (quest::CQuestManager::instance().GetEventFlag("disable_shop_search"))
    {
        ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Item arama penceresi suanda devre disi."));
        return;
    }
/*
    if (!FindSpecifyItem(60004) && !FindSpecifyItem(60005))
    {
        ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Ticaret camina sahip olmadan arama yapamazsin."));
        return;
    }
*/
    if (bJob < JOB_WARRIOR || bJob > JOB_SHAMAN)
        return;
    if (bItemType < ITEM_NONE || bItemType > ITEM_BELT)
        return;
    if (bItemSubType < USE_POTION || bItemSubType > USE_PUT_INTO_RING_SOCKET)
        return;
    if (bMinLevel < 0 || bMinLevel > PLAYER_MAX_LEVEL_CONST)
        return;
    if (bMaxLevel < 0 || bMaxLevel > PLAYER_MAX_LEVEL_CONST)
        return;
    if (bMinRefine < 0 || bMinRefine > 9)
        return;
    if (bMaxRefine < 0 || bMaxRefine > 9)
        return;
    if (lMinGold < 0 || lMinGold > GOLD_MAX)
        return;
    if (lMaxGold < 0 || lMaxGold > GOLD_MAX)
        return;
    if (bMinCheque < 0 || bMinCheque > CHEQUE_MAX)
        return;
    if (bMaxCheque < 0 || bMaxCheque > CHEQUE_MAX)
        return;
    if (bMinLevel > bMaxLevel)
        return;
    if (bMinRefine > bMaxRefine)
        return;
    if (lMinGold > lMaxGold)
        return;
    if (bMinCheque > bMaxCheque)
        return;

    quest::PC* pPC = quest::CQuestManager::instance().GetPC(GetPlayerID());

    if (!pPC)
        return;

    DWORD dwShopSearchSecCycle = 5;
    DWORD dwNowSec = get_global_time();
    DWORD dwLastShopSearchAttrSec = pPC->GetFlag("ShopSearch.LastShopSearchSecAttr");

    if (dwLastShopSearchAttrSec + dwShopSearchSecCycle > dwNowSec)
    {
        ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Tekrar arama yapabilmek icin %d sn. beklemelisin. Kalan sure %d sn."), (dwShopSearchSecCycle, dwShopSearchSecCycle - (dwNowSec - dwLastShopSearchAttrSec)));
        return;
    }

    pPC->SetFlag("ShopSearch.LastShopSearchSecAttr", dwNowSec);

    LPSECTREE_MAP pMap = SECTREE_MANAGER::instance().GetMap(GetMapIndex());

    if (!pMap)
        return;

    FFindShopSearch f(this);
    pMap->for_each(f);

    if (f.m_mapPcShop.empty())
        return;

    std::vector<COfflineShop::OFFLINE_SHOP_ITEM> sendItems;

    for (std::map<DWORD, LPCHARACTER>::iterator iter = f.m_mapPcShop.begin(); iter != f.m_mapPcShop.end(); ++iter)
    {
        LPCHARACTER tch = iter->second;

        if (!tch)
            continue;
      
        if (!tch->IsOfflineShopNPC() || !tch->GetOfflineShop())
            continue;

        std::vector<COfflineShop::OFFLINE_SHOP_ITEM> offlineShopItem = tch->GetOfflineShop()->GetItemVector();
        for (std::vector<COfflineShop::OFFLINE_SHOP_ITEM>::iterator iter2 = offlineShopItem.begin(); iter2 != offlineShopItem.end(); ++iter2)
        {
            if (iter2->bIsSold)
                continue;

            if (bNameOnly)
            {
                std::string strItemName(c_szItemName);
                if (strItemName.length() > 2)
                {
                    if (!((iter2->bItemLevel >= bMinLevel && iter2->bItemLevel <= bMaxLevel) || iter2->bItemLevel == 0))
                        continue;

                    if (!(iter2->price >= lMinGold && iter2->price <= lMaxGold))
                        continue;

#ifdef ENABLE_CHEQUE_SYSTEM
                    if (!(iter2->cheque >= bMinCheque && iter2->cheque <= bMaxCheque))
                        continue;
#endif

                    bool pushback = false;

                    std::string foundName(iter2->szItemName);

                    if (foundName.find(strItemName) != std::string::npos)
                        pushback = true;

                    if (pushback)
                    {
                        iter2->dwShopVID = iter->first;
                        strncpy(iter2->szOwnerName, tch->GetName(), CHARACTER_NAME_MAX_LEN);
                        sendItems.push_back(*iter2);
                    }
                }
            }
            else
            {
                if (iter2->bItemType == bItemType && iter2->bItemSubType == bItemSubType)
                {
                    if ((iter2->bItemType == ITEM_WEAPON || iter2->bItemType == ITEM_ARMOR) && !(iter2->bItemRefine >= bMinRefine && iter2->bItemRefine <= bMaxRefine))
                        continue;

                    if (!((iter2->bItemLevel >= bMinLevel && iter2->bItemLevel <= bMaxLevel) || iter2->bItemLevel == 0))
                        continue;

                    if (!(iter2->price >= lMinGold && iter2->price <= lMaxGold))
                        continue;

#ifdef ENABLE_CHEQUE_SYSTEM
                    if (!(iter2->cheque >= bMinCheque && iter2->cheque <= bMaxCheque))
                        continue;
#endif

                    bool cont = false;
                    switch (bJob)
                    {
                    case JOB_WARRIOR:
                        if (iter2->dwAntiFlag & ITEM_ANTIFLAG_WARRIOR)
                            cont = true;
                        break;

                    case JOB_ASSASSIN:
                        if (iter2->dwAntiFlag & ITEM_ANTIFLAG_ASSASSIN)
                            cont = true;
                        break;

                    case JOB_SHAMAN:
                        if (iter2->dwAntiFlag & ITEM_ANTIFLAG_SHAMAN)
                            cont = true;
                        break;

                    case JOB_SURA:
                        if (iter2->dwAntiFlag & ITEM_ANTIFLAG_SURA)
                            cont = true;
                        break;
                    }

                    if (cont)
                        continue;

                    iter2->dwShopVID = iter->first;
                    strncpy(iter2->szOwnerName, tch->GetName(), CHARACTER_NAME_MAX_LEN);
                    sendItems.push_back(*iter2);

                }
            }
        }
    }

    std::stable_sort(sendItems.begin(), sendItems.end(), CompareItemVnumAcPriceAC);

    for (std::vector<COfflineShop::OFFLINE_SHOP_ITEM>::iterator iter = sendItems.begin(); iter != sendItems.end(); ++iter)
    {
        if (!IsPC() || !iter->dwShopVID)
            continue;

        TPacketGCShopSearchItemInfo pack;
        pack.bHeader = HEADER_GC_PSHOP_SEARCH_ITEM_INFO;

        pack.dwVID = iter->dwShopVID;
        strlcpy(pack.szOwnerName, iter->szOwnerName, CHARACTER_NAME_MAX_LEN);
        pack.bPos = iter->pos;

        pack.dwGold = iter->price;

#ifdef ENABLE_CHEQUE_SYSTEM
        pack.bCheque = iter->cheque;
#endif
        pack.dwVnum = iter->vnum;
        pack.bCount = static_cast<BYTE>(iter->count);
        pack.dwFlags = iter->dwFlag;
        pack.dwAntiFlags = iter->dwAntiFlag;

        thecore_memcpy(pack.alSockets, iter->alSockets, sizeof(pack.alSockets));
        thecore_memcpy(pack.aAttr, iter->aAttr, sizeof(pack.aAttr));
        GetDesc()->LargePacket(&pack, sizeof(TPacketGCShopSearchItemInfo));
    }
}

Sistem Linki :
Linkleri görebilmek için giriş yap veya kayıt ol.
 
Son düzenleme:
Kodlama da iyi sayılmam fakat tahminimi belirteyim yinede :D

comparison is always false due to limited range of data type
sınırlı veri türü aralığı nedeniyle karşılaştırma her zaman yanlıştır

left-hand operand comma has no effect
sol taraftaki işlenen virgülünün etkisi yoktur

İlk warningde sınırlı dediğine göre sanırım char'dan bahsediyor olabilir. Ya da sınırlandırılmış bir başka veri tipini. Bu değişkenlerin türünü yükseltmek mi gerekiyor acaba ? ..
 
Koşullarda belli aralıklar ile kontrol ediyor. Fakat kontrol eden rakamlar veritipini geçerse bu hatayı verebilir. ShopSearchInfo fonksiyonunun tamamını ekleyebilir misiniz? Genel olarak kontrol edelim.
 
Ekledim birde en son warninge süre sayıyor 5den geri -48445 kalan felan diyor
 
En iyisi char_item.cpp dosyasını bi yere upload eder misiniz? Satır numaraları çok farklı olduğu için ney nerede kestiremiyorum. :D
 
8864. satırda veren hata için;
Bunu;
C++:
Genişlet Daralt Kopyala
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Tekrar arama yapabilmek icin %d sn. beklemelisin. Kalan sure %d sn."), (dwShopSearchSecCycle, dwShopSearchSecCycle - (dwNowSec - dwLastShopSearchAttrSec)));

Şöyle değiştirip deneyebilir misiniz?
C++:
Genişlet Daralt Kopyala
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Tekrar arama yapabilmek icin %d sn. beklemelisin. Kalan sure %d sn."), dwShopSearchSecCycle, dwShopSearchSecCycle - (dwNowSec - dwLastShopSearchAttrSec));

8840 ve 8842. satırda veren hata için;
Sanırsam CHEQUE_MAX değerini 255'den fazla. Bu yüzden hata veriyor olabilir.
Şu kodları;
C++:
Genişlet Daralt Kopyala
    if (bMinCheque < 0 || bMinCheque > CHEQUE_MAX)
        return;
    if (bMaxCheque < 0 || bMaxCheque > CHEQUE_MAX)
        return;

Şöyle değiştiriniz;
C++:
Genişlet Daralt Kopyala
    if (bMinCheque < 0 || bMinCheque >= CHEQUE_MAX)
        return;
    if (bMaxCheque < 0 || bMaxCheque >= CHEQUE_MAX)
        return;

8826. satırda veren hata için;
C++:
Genişlet Daralt Kopyala
    if (bItemSubType < USE_POTION || bItemSubType > USE_PUT_INTO_RING_SOCKET)
        return;

Yukarıdaki koşul tamamen mantıksız. Her item türü için farklı sayıda sub olabilir. Bu yüzden kodu şöyle değiştirin;
C++:
Genişlet Daralt Kopyala
    if (bItemSubType < 0)
        return;


8822. satırda veren hata için;
C++:
Genişlet Daralt Kopyala
    if (bJob < JOB_WARRIOR || bJob > JOB_SHAMAN)
        return;

Değiştir;
C++:
Genişlet Daralt Kopyala
    if (bJob < JOB_WARRIOR || bJob >= JOB_MAX_NUM)
        return;

Bunları bi deneyin bakalım değişiklik olacak mı?
 
sadece son warning kalktı digerleri hala devam ediyor

Kod:
Genişlet Daralt Kopyala
char_item.cpp: In member function 'void CHARACTER::ShopSearchInfo(bool, BYTE, BY                                               TE, BYTE, BYTE, BYTE, BYTE, BYTE, long int, long int, BYTE, BYTE, const char*)':
char_item.cpp:8822: warning: comparison is always false due to limited range of                                                data type
char_item.cpp:8824: warning: comparison is always false due to limited range of                                                data type
char_item.cpp:8826: warning: comparison is always false due to limited range of                                                data type
char_item.cpp:8828: warning: comparison is always false due to limited range of                                                data type
char_item.cpp:8830: warning: comparison is always false due to limited range of                                                data type
char_item.cpp:8832: warning: comparison is always false due to limited range of                                                data type
char_item.cpp:8834: warning: comparison is always false due to limited range of                                                data type
char_item.cpp:8840: warning: comparison is always false due to limited range of                                                data type
char_item.cpp:8840: warning: comparison is always false due to limited range of                                                data type
char_item.cpp:8842: warning: comparison is always false due to limited range of                                                data type
char_item.cpp:8842: warning: comparison is always false due to limited range of                                                data type
 
game/src/Makefile dosyasınızda yazan kodları verebilir misiniz?
 
Buyrun
Kod:
Genişlet Daralt Kopyala
CC = g++

GAME_VERSION := $(shell cat ../../__REVISION__)

GccMajorVersion := $(shell expr `$(CC) -dumpversion | cut -f1 -d.`)
GccMinorVersion := $(shell expr `$(CC) -dumpversion | cut -f2 -d.`)
GccMinorEGT8 := $(shell expr $(GccMinorVersion) \>= 8)

INCDIR =
LIBDIR =
BINDIR = ..
OBJDIR = .obj
$(shell if [ ! -d $(OBJDIR) ]; then mkdir $(OBJDIR); fi)

## LIST OF CONSTANTS BEGIN
ENABLE_LUA_5_VERSION = 0
ENABLE_GCC_AUTODEPEND = 1
ENABLE_STATIC = 0
## LIST OF CONSTANTS END

# Depend Path File
ifneq ($(ENABLE_GCC_AUTODEPEND), 1)
DEPFILE = Depend
endif

# Standard Libraries
LIBS = -lm -lmd

# Project Flags
CFLAGS = -m32 -g -Wall -O2 -pipe -fexceptions -fno-strict-aliasing -pthread -D_THREAD_SAFE -DNDEBUG

ifeq ($(ENABLE_STATIC), 1)
CFLAGS += -static
endif

ifeq ($(GccMinorEGT8), 1)
CFLAGS += -Wno-unused-local-typedefs
endif

# FreeBSD stack protector
CFLAGS += -fstack-protector-all

# Version defines
CFLAGS += -D__USER__=\"$(USER)\" -D__HOSTNAME__=\"$(HOSTNAME)\" -D__PWD__=\"$(PWD)\" -D__GAME_VERSION__=\"$(GAME_VERSION)\"

# Boost
INCDIR += -I../../../Extern/include/boost

# DevIL
INCDIR += -I../../../Extern/include/IL
LIBS += ../../../Extern/lib/libIL.a\
        ../../../Extern/lib/libjasper.a\
        ../../../Extern/lib/libpng.a\
        ../../../Extern/lib/libtiff.a\
        ../../../Extern/lib/libjbig.a\
        ../../../Extern/lib/libmng.a\
        /usr/lib/liblzma.a\
        ../../../Extern/lib/liblcms.a\
        ../../../Extern/lib/libjpeg.a

# MySQL
INCDIR += -I/usr/local/include/mysql
LIBS += /usr/local/lib/mysql/libmysqlclient.a /usr/lib/libz.a

# CryptoPP
LIBS += ../../../Extern/lib/libcryptopp.a

# OpenSSL
INCDIR += -I/usr/include
LIBS += -lssl
# LIBS += /usr/lib/libssl.a

# Lua
CFLAGS += -DENABLE_LUA_5_VERSION=ENABLE_LUA_5_VERSION
ifeq ($(ENABLE_LUA_5_VERSION), 2)
INCDIR += -I../../liblua/5.2/install/include
LIBDIR += -L../../liblua/5.2/install/lib
LIBS += ../../liblua/5.2/install/lib/liblua.a
else
INCDIR += -I../../liblua/5.0/include
LIBDIR += -L../../liblua/5.0/lib
LIBS += ../../liblua/5.0/lib/liblua.a ../../liblua/5.0/lib/liblualib.a
endif

# Project Libraries
INCDIR += -I../../../Extern/include
INCDIR += -I/usr/local/include
LIBDIR += -L/usr/local/lib

INCDIR += -I../../libserverkey
LIBDIR += -L../../libthecore/lib -L../../libpoly -L../../libsql -L../../libgame/lib -L../../libserverkey
LIBS += -lthecore -lpoly -lsql -lgame -lserverkey

# PROJECT_SRC_FILES BEGIN
MAINCPP = main.cpp
TESTCPP = test.cpp

CFILE    = minilzo.c

CPPFILE = BattleArena.cpp FSM.cpp MarkConvert.cpp MarkImage.cpp MarkManager.cpp OXEvent.cpp TrafficProfiler.cpp ani.cpp\
          arena.cpp banword.cpp battle.cpp blend_item.cpp block_country.cpp buffer_manager.cpp building.cpp castle.cpp\
          char.cpp char_affect.cpp char_battle.cpp char_change_empire.cpp char_horse.cpp char_item.cpp char_manager.cpp\
          char_quickslot.cpp char_resist.cpp char_skill.cpp char_state.cpp PetSystem.cpp cmd.cpp cmd_emotion.cpp cmd_general.cpp\
          cmd_gm.cpp cmd_oxevent.cpp config.cpp constants.cpp crc32.cpp cube.cpp db.cpp desc.cpp\
          desc_client.cpp desc_manager.cpp desc_p2p.cpp dev_log.cpp dungeon.cpp empire_text_convert.cpp entity.cpp\
          entity_view.cpp event.cpp event_queue.cpp exchange.cpp file_loader.cpp fishing.cpp gm.cpp guild.cpp\
          guild_manager.cpp guild_war.cpp horse_rider.cpp horsename_manager.cpp input.cpp input_auth.cpp input_db.cpp\
          input_login.cpp input_main.cpp input_p2p.cpp input_udp.cpp ip_ban.cpp\
          item.cpp item_addon.cpp item_attribute.cpp item_manager.cpp item_manager_idrange.cpp locale.cpp\
          locale_service.cpp log.cpp login_data.cpp lzo_manager.cpp marriage.cpp\
          messenger_manager.cpp mining.cpp mob_manager.cpp monarch.cpp motion.cpp over9refine.cpp p2p.cpp packet_info.cpp\
          party.cpp pcbang.cpp polymorph.cpp priv_manager.cpp pvp.cpp\
          questevent.cpp questlua.cpp questlua_affect.cpp questlua_arena.cpp questlua_ba.cpp questlua_building.cpp\
          questlua_danceevent.cpp questlua_dungeon.cpp questlua_forked.cpp questlua_game.cpp questlua_global.cpp\
          questlua_guild.cpp questlua_horse.cpp questlua_pet.cpp questlua_item.cpp questlua_marriage.cpp questlua_mgmt.cpp\
          questlua_monarch.cpp questlua_npc.cpp questlua_oxevent.cpp questlua_party.cpp questlua_pc.cpp\
          questlua_quest.cpp questlua_target.cpp questmanager.cpp questnpc.cpp questpc.cpp\
          refine.cpp regen.cpp safebox.cpp sectree.cpp sectree_manager.cpp sequence.cpp shop.cpp\
          skill.cpp start_position.cpp target.cpp text_file_loader.cpp trigger.cpp utils.cpp vector.cpp war_map.cpp\
          wedding.cpp xmas_event.cpp version.cpp panama.cpp threeway_war.cpp map_location.cpp\
          BlueDragon.cpp BlueDragon_Binder.cpp DragonLair.cpp questlua_dragonlair.cpp\
          skill_power.cpp affect.cpp\
          SpeedServer.cpp questlua_speedserver.cpp\
          FileMonitor_FreeBSD.cpp ClientPackageCryptInfo.cpp cipher.cpp\
          buff_on_attributes.cpp dragon_soul_table.cpp DragonSoul.cpp\
          group_text_parse_tree.cpp char_dragonsoul.cpp questlua_dragonsoul.cpp\
          shop_manager.cpp shopEx.cpp item_manager_read_tables.cpp shutdown_manager.cpp offlineshop.cpp offlineshop_manager.cpp
# PROJECT_SRC_FILES END

# PROJECT_OBJ_FILES BEGIN
COBJS    = $(CFILE:%.c=$(OBJDIR)/%.o)
CPPOBJS    = $(CPPFILE:%.cpp=$(OBJDIR)/%.o)
ifeq ($(ENABLE_GCC_AUTODEPEND), 1)
CDEPS    = $(COBJS:%.o=%.d)
CPPDEPS    = $(CPPOBJS:%.o=%.d)
endif

MAINOBJ = $(MAINCPP:%.cpp=$(OBJDIR)/%.o)
ifeq ($(ENABLE_GCC_AUTODEPEND), 1)
MAINDEPS = $(MAINOBJ:%.o=%.d)
endif

TESTOBJ = $(TESTCPP:%.cpp=$(OBJDIR)/%.o)
ifeq ($(ENABLE_GCC_AUTODEPEND), 1)
TESTDEPS = $(TESTOBJ:%.o=%.d)
endif
# PROJECT_OBJ_FILES END

# Target Paths
MAIN_TARGET = $(BINDIR)/game
TEST_TARGET = $(BINDIR)/test

# previously -> default: $(MAIN_TARGET) $(TEST_TARGET)
default: $(MAIN_TARGET)
test: $(TEST_TARGET)

$(OBJDIR)/%.o: %.c
    @echo compiling $<
    @$(CC) $(CFLAGS) $(INCDIR) -c $< -o $@
ifeq ($(ENABLE_GCC_AUTODEPEND), 1)
    @$(CC) -MM -MG -MP $(CFLAGS) $(INCDIR) -c $< -o $(OBJDIR)/$*.d
    @sed -i '' -e's/$*.o:/$(OBJDIR)\/$*.o:/g' $(OBJDIR)/$*.d
endif

$(OBJDIR)/%.o: %.cpp
    @echo compiling $<
    @$(CC) $(CFLAGS) $(INCDIR) -c $< -o $@
ifeq ($(ENABLE_GCC_AUTODEPEND), 1)
    @$(CC) -MM -MG -MP $(CFLAGS) $(INCDIR) -c $< -o $(OBJDIR)/$*.d
    @sed -i '' -e's/$*.o:/$(OBJDIR)\/$*.o:/g' $(OBJDIR)/$*.d
endif

limit_time:
    @echo update limit time
    @python update_limit_time.py

$(MAIN_TARGET): $(CPPOBJS) $(COBJS) $(MAINOBJ)
    @echo linking $(MAIN_TARGET)
    @$(CC) $(CFLAGS) $(LIBDIR) $(COBJS) $(CPPOBJS) $(MAINOBJ) $(LIBS) -o $(MAIN_TARGET)

$(TEST_TARGET): $(TESTCPP) $(CPPOBJS) $(COBJS) $(TESTOBJ)
    @echo linking $(TEST_TARGET)
    @$(CC) $(CFLAGS) $(LIBDIR) $(COBJS) $(CPPOBJS) $(TESTOBJ) $(LIBS) -o $(TEST_TARGET)

dump:
    @$(CC) -dM -E - < /dev/null > .nope.nope

#symlink:
#    @ln -fs game_r$(GAME_VERSION) $(BINDIR)/game_symlink

strip:
    @cp $(MAIN_TARGET) $(BINDIR)/game
    @strip $(BINDIR)/game

clean:
    @echo cleaning $(MAIN_TARGET) $(TEST_TARGET) $(OBJDIR)
    @rm -f $(COBJS) $(CPPOBJS) $(MAINOBJ) $(TESTOBJ)
ifeq ($(ENABLE_GCC_AUTODEPEND), 1)
    @rm -f $(CDEPS) $(CPPDEPS) $(MAINDEPS) $(TESTDEPS)
endif
    @rm -f $(BINDIR)/game $(BINDIR)/test_r* $(BINDIR)/conv

cc-ver:
    @$(CC) -v

tag:
    ctags *.cpp *.h *.c

dep:
ifeq ($(ENABLE_GCC_AUTODEPEND), 1)
    @echo "Note: gcc autodepend is autodetected, so target dep skipped"
else
    makedepend -f $(DEPFILE) $(INCDIR) -I/usr/include/c++/3.3 -I/usr/include/c++/4.2 -p$(OBJDIR)/ $(CPPFILE) $(CFILE) $(MAINCPP) $(TESTCPP) 2> /dev/null > $(DEPFILE)
endif

# AUTO_DEPEND_CHECK BEGIN
ifeq ($(ENABLE_GCC_AUTODEPEND), 1)
sinclude $(CDEPS)
sinclude $(CPPDEPS)
sinclude $(MAINDEPS)
sinclude $(TESTDEPS)
else
sinclude $(DEPFILE)
endif
# AUTO_DEPEND_CHECK END
 
Eğer bu şekilde itemshop düzgün çalışıyorsa makefile dosyanıza şunu ekledikten sonra tekrar derleyin. Bu şekilde uyarı gizlenmiş olacak.
CFLAGS += -Wno-type-limits

Yukarıdaki komut olmazsa şunu deneyin.
CFLAGS += -Wextra
 
Hangisini degistirmeliyim 1den fazla var
 
Değiştirmeyin.
Kod:
Genişlet Daralt Kopyala
CFLAGS = -m32 -g -Wall -O2 -pipe -fexceptions -fno-strict-aliasing -pthread -D_THREAD_SAFE -DNDEBUG
Bunun altına ekleyin

Kod:
Genişlet Daralt Kopyala
CFLAGS += -Wno-type-limits


Bu sadece hatayı gizler. Eğer oyun içindeki testlerde doğru çalışıyorsa bunu uygulayın. Doğru çalışmıyorsa bir şekilde çözmek gerekiyor.
 
dediginiz şeyleri ekleyince buna benzer birsürü warning veriyor

Kod:
Genişlet Daralt Kopyala
../../../Extern/include/cryptopp/cryptlib.h:402: warning: unused parameter 'iv'
../../../Extern/include/cryptopp/cryptlib.h:402: warning: unused parameter 'ivLength'
../../../Extern/include/cryptopp/cryptlib.h:418: warning: unused parameter 'length'
../../../Extern/include/cryptopp/cryptlib.h:511: warning: unused parameter 'n'
../../../Extern/include/cryptopp/cryptlib.h:659: warning: unused parameter 'headerLength'
../../../Extern/include/cryptopp/cryptlib.h:659: warning: unused parameter 'messageLength'
../../../Extern/include/cryptopp/cryptlib.h:659: warning: unused parameter 'footerLength'
../../../Extern/include/cryptopp/cryptlib.h:673: warning: unused parameter 'input'
../../../Extern/include/cryptopp/cryptlib.h:673: warning: unused parameter 'length'
../../../Extern/include/cryptopp/cryptlib.h:833: warning: unused parameter 'parameters'
../../../Extern/include/cryptopp/cryptlib.h:835: warning: unused parameter 'blocking'
../../../Extern/include/cryptopp/cryptlib.h:857: warning: unused parameter 'propagation'
../../../Extern/include/cryptopp/cryptlib.h:1016: warning: unused parameter 'newAttachment'
../../../Extern/include/cryptopp/cryptlib.h:1065: warning: unused parameter 'bt'
../../../Extern/include/cryptopp/cryptlib.h:1072: warning: unused parameter 'bt'
../../../Extern/include/cryptopp/cryptlib.h:1081: warning: unused parameter 'n'
../../../Extern/include/cryptopp/cryptlib.h:1084: warning: unused parameter 'storedPrecomputation'
../../../Extern/include/cryptopp/cryptlib.h:1087: warning: unused parameter 'storedPrecomputation'
../../../Extern/include/cryptopp/cryptlib.h:1107: warning: unused parameter 'rng'
../../../Extern/include/cryptopp/cryptlib.h:1107: warning: unused parameter 'params'
../../../Extern/include/cryptopp/cryptlib.h:1308: warning: unused parameter 'recoverablePartLength'
../../../Extern/include/cryptopp/cryptlib.h:1341: warning: unused parameter 'digest'
../../../Extern/include/cryptopp/cryptlib.h:1341: warning: unused parameter 'digestSize'
 
O zaman işlemleri geri alın.

Güncelleme ///
Anydesk ile bağlanıp baya bi üzerinde çalıştık ama sorunun çözümünü bulamadık.
Freebsd 9.2, gcc 4.2 kullanıyor.

char_item.cpp:8822: warning: comparison is always false due to limited range of data type
Sorunu çözemesek bile bu hatanın neyden kaynaklandığını bulduk.

C++:
Genişlet Daralt Kopyala
    if (bJob < JOB_WARRIOR || bJob > JOB_SHAMAN)
        return;
Bu koşul aslında şu sayısal değerlerde kontrol yapıyor. bJob < 0 || bJob > 3

0'dan düşükse kontrollerinin olduğu her yerde warningi veriyor. Eğer bunla ilgili bi bilgisi olan varsa lütfen yorumlarını eksik etmesin. :)
 
Sistem linkini konuya dahil ettim.
 
Durum
İçerik kilitlendiği için mesaj gönderimine kapatıldı.
Geri
Üst