Browse Source

Clang-tidy: readability-inconsistent-declaration-parameter-name

pull/2243/head
Anders Jenbo 5 years ago
parent
commit
790f42d078
  1. 2
      Source/DiabloUI/diabloui.h
  2. 4
      Source/DiabloUI/text_draw.h
  3. 2
      Source/DiabloUI/ttf_render_wrapped.h
  4. 2
      Source/controls/axis_direction.h
  5. 2
      Source/controls/controller_motion.h
  6. 6
      Source/controls/devices/game_controller.h
  7. 6
      Source/controls/devices/joystick.h
  8. 2
      Source/controls/touch.h
  9. 2
      Source/drlg_l1.h
  10. 4
      Source/drlg_l2.h
  11. 12
      Source/dvlnet/base.cpp
  12. 2
      Source/dvlnet/base.h
  13. 4
      Source/dvlnet/packet.h
  14. 2
      Source/dvlnet/tcp_client.h
  15. 2
      Source/dvlnet/tcp_server.h
  16. 6
      Source/inv.cpp
  17. 2
      Source/items.h
  18. 2
      Source/miniwin/miniwin.h
  19. 2
      Source/msg.h
  20. 2
      Source/objects.h
  21. 10
      Source/player.cpp
  22. 2
      Source/utils/soundsample.h

2
Source/DiabloUI/diabloui.h

@ -118,7 +118,7 @@ void UiFocusNavigationSelect();
void UiFocusNavigationEsc();
void UiFocusNavigationYesNo();
void UiInitList(int count, void (*fnFocus)(int value), void (*fnSelect)(int value), void (*fnEsc)(), const std::vector<UiItemBase *> &items, bool wraps = false, bool (*fnYesNo)() = NULL);
void UiInitScrollBar(UiScrollBar *ui_sb, std::size_t viewport_size, const std::size_t *current_offset);
void UiInitScrollBar(UiScrollBar *uiSb, std::size_t viewportSize, const std::size_t *currentOffset);
void UiClearScreen();
void UiPollAndRender();
void UiRenderItems(const std::vector<UiItemBase *> &items);

4
Source/DiabloUI/text_draw.h

@ -12,8 +12,8 @@ struct TtfSurfaceCache {
};
void DrawTTF(const char *text, const SDL_Rect &rect, int flags,
const SDL_Color &text_color, const SDL_Color &shadow_color,
TtfSurfaceCache &render_cache);
const SDL_Color &textColor, const SDL_Color &shadowColor,
TtfSurfaceCache &renderCache);
void DrawArtStr(const char *text, const SDL_Rect &rect, int flags, bool drawTextCursor = false);

2
Source/DiabloUI/ttf_render_wrapped.h

@ -18,6 +18,6 @@ enum TextAlignment : uint8_t {
* This method is slow. Caching the result is recommended.
*/
SDL_Surface *RenderUTF8_Solid_Wrapped(
TTF_Font *font, const char *text, SDL_Color fg, Uint32 wrapLength, const int x_align = TextAlignment_BEGIN);
TTF_Font *font, const char *text, SDL_Color fg, Uint32 wrapLength, const int xAlign = TextAlignment_BEGIN);
} // namespace devilution

2
Source/controls/axis_direction.h

@ -37,7 +37,7 @@ public:
{
}
AxisDirection Get(AxisDirection axis_direction);
AxisDirection Get(AxisDirection axisDirection);
private:
int last_left_;

2
Source/controls/controller_motion.h

@ -22,6 +22,6 @@ extern bool leftStickNeedsScaling, rightStickNeedsScaling;
bool ProcessControllerMotion(const SDL_Event &event, ControllerButtonEvent ctrlEvent);
// Returns direction of the left thumb stick or DPad (if allow_dpad = true).
AxisDirection GetLeftStickOrDpadDirection(bool allow_dpad = true);
AxisDirection GetLeftStickOrDpadDirection(bool allowDpad = true);
} // namespace devilution

6
Source/controls/devices/game_controller.h

@ -14,9 +14,9 @@ class GameController {
static std::vector<GameController> *const controllers_;
public:
static void Add(int joystick_index);
static void Remove(SDL_JoystickID instance_id);
static GameController *Get(SDL_JoystickID instance_id);
static void Add(int joystickIndex);
static void Remove(SDL_JoystickID instanceId);
static GameController *Get(SDL_JoystickID instanceId);
static GameController *Get(const SDL_Event &event);
static const std::vector<GameController> &All();
static bool IsPressedOnAnyController(ControllerButton button);

6
Source/controls/devices/joystick.h

@ -18,9 +18,9 @@ class Joystick {
static std::vector<Joystick> *const joysticks_;
public:
static void Add(int device_index);
static void Remove(SDL_JoystickID instance_id);
static Joystick *Get(SDL_JoystickID instance_id);
static void Add(int deviceIndex);
static void Remove(SDL_JoystickID instanceId);
static Joystick *Get(SDL_JoystickID instanceId);
static Joystick *Get(const SDL_Event &event);
static const std::vector<Joystick> &All();
static bool IsPressedOnAnyJoystick(ControllerButton button);

2
Source/controls/touch.h

@ -5,7 +5,7 @@
namespace devilution {
#ifndef USE_SDL1
void handle_touch(SDL_Event *event, int current_mouse_x, int current_mouse_y);
void handle_touch(SDL_Event *event, int currentMouseX, int currentMouseY);
#endif
} // namespace devilution

2
Source/drlg_l1.h

@ -22,7 +22,7 @@ extern int UberDiabloMonsterIndex;
void DRLG_LPass3(int lv);
void DRLG_Init_Globals();
void LoadL1Dungeon(const char *path, int vx, int vy);
void LoadPreL1Dungeon(const char *sFileName);
void LoadPreL1Dungeon(const char *path);
void CreateL5Dungeon(uint32_t rseed, lvl_entry entry);
void drlg_l1_set_crypt_room(int rx1, int ry1);
void drlg_l1_set_corner_room(int rx1, int ry1);

4
Source/drlg_l2.h

@ -28,8 +28,8 @@ struct ROOMNODE {
extern BYTE predungeon[DMAXX][DMAXY];
void InitDungeon();
void LoadL2Dungeon(const char *sFileName, int vx, int vy);
void LoadPreL2Dungeon(const char *sFileName);
void LoadL2Dungeon(const char *path, int vx, int vy);
void LoadPreL2Dungeon(const char *path);
void CreateL2Dungeon(uint32_t rseed, lvl_entry entry);
} // namespace devilution

12
Source/dvlnet/base.cpp

@ -119,20 +119,20 @@ bool base::SNetReceiveMessage(int *sender, char **data, int *size)
return true;
}
bool base::SNetSendMessage(int playerID, void *data, unsigned int size)
bool base::SNetSendMessage(int playerId, void *data, unsigned int size)
{
if (playerID != SNPLAYER_ALL && playerID != SNPLAYER_OTHERS
&& (playerID < 0 || playerID >= MAX_PLRS))
if (playerId != SNPLAYER_ALL && playerId != SNPLAYER_OTHERS
&& (playerId < 0 || playerId >= MAX_PLRS))
abort();
auto *rawMessage = reinterpret_cast<unsigned char *>(data);
buffer_t message(rawMessage, rawMessage + size);
if (playerID == plr_self || playerID == SNPLAYER_ALL)
if (playerId == plr_self || playerId == SNPLAYER_ALL)
message_queue.emplace_back(plr_self, message);
plr_t dest;
if (playerID == SNPLAYER_ALL || playerID == SNPLAYER_OTHERS)
if (playerId == SNPLAYER_ALL || playerId == SNPLAYER_OTHERS)
dest = PLR_BROADCAST;
else
dest = playerID;
dest = playerId;
if (dest != plr_self) {
auto pkt = pktfty->make_packet<PT_MESSAGE>(plr_self, dest, message);
send(*pkt);

2
Source/dvlnet/base.h

@ -18,7 +18,7 @@ public:
virtual int join(std::string addrstr, std::string passwd) = 0;
virtual bool SNetReceiveMessage(int *sender, char **data, int *size);
virtual bool SNetSendMessage(int dest, void *data, unsigned int size);
virtual bool SNetSendMessage(int playerId, void *data, unsigned int size);
virtual bool SNetReceiveTurns(char **data, unsigned int *size,
DWORD *status);
virtual bool SNetSendTurn(char *data, unsigned int size);

4
Source/dvlnet/packet.h

@ -29,7 +29,7 @@ enum packet_type : uint8_t {
};
// Returns NULL for an invalid packet type.
const char *packet_type_to_string(uint8_t packet_type);
const char *packet_type_to_string(uint8_t packetType);
typedef uint8_t plr_t;
typedef uint32_t cookie_t;
@ -55,7 +55,7 @@ public:
class wrong_packet_type_exception : public packet_exception {
public:
wrong_packet_type_exception(std::initializer_list<packet_type> expected_types, std::uint8_t actual);
wrong_packet_type_exception(std::initializer_list<packet_type> expectedTypes, std::uint8_t actual);
const char *what() const throw() override
{

2
Source/dvlnet/tcp_client.h

@ -38,7 +38,7 @@ private:
asio::ip::tcp::socket sock = asio::ip::tcp::socket(ioc);
std::unique_ptr<tcp_server> local_server; // must be declared *after* ioc
void handle_recv(const asio::error_code &error, size_t bytes_read);
void handle_recv(const asio::error_code &error, size_t bytesRead);
void start_recv();
void handle_send(const asio::error_code &error, size_t bytes_sent);
};

2
Source/dvlnet/tcp_server.h

@ -63,7 +63,7 @@ private:
void start_accept();
void handle_accept(const scc &con, const asio::error_code &ec);
void start_recv(const scc &con);
void handle_recv(const scc &con, const asio::error_code &ec, size_t bytes_read);
void handle_recv(const scc &con, const asio::error_code &ec, size_t bytesRead);
void handle_recv_newplr(const scc &con, packet &pkt);
void handle_recv_packet(packet &pkt);
void send_connect(const scc &con);

6
Source/inv.cpp

@ -559,20 +559,20 @@ bool AutoEquip(int playerId, const ItemStruct &item, inv_body_loc bodyLocation,
/**
* @brief Automatically attempts to equip the specified item in the most appropriate location in the player's body.
* @note On success, this will broadcast an equipment_change event to let other players know about the equipment change.
* @param playerNumber The player number whose inventory will be checked for compatibility with the item.
* @param playerId The player number whose inventory will be checked for compatibility with the item.
* @param item The item to equip.
* @param persistItem Indicates whether or not the item should be persisted in the player's body. Pass 'False' to check
* whether the player can equip the item but you don't want the item to actually be equipped. 'True' by default.
* @return 'True' if the item was equipped and 'False' otherwise.
*/
bool AutoEquip(int playerNumber, const ItemStruct &item, bool persistItem)
bool AutoEquip(int playerId, const ItemStruct &item, bool persistItem)
{
if (!CanEquip(item)) {
return false;
}
for (int bodyLocation = INVLOC_HEAD; bodyLocation < NUM_INVLOC; bodyLocation++) {
if (AutoEquip(playerNumber, item, (inv_body_loc)bodyLocation, persistItem)) {
if (AutoEquip(playerId, item, (inv_body_loc)bodyLocation, persistItem)) {
return true;
}
}

2
Source/items.h

@ -465,7 +465,7 @@ void RecalcStoreStats();
int ItemNoFlippy();
void CreateSpellBook(Point position, spell_id ispell, bool sendmsg, bool delta);
void CreateMagicArmor(Point position, int imisc, int icurs, bool sendmsg, bool delta);
void CreateAmulet(Point position, int curlv, bool sendmsg, bool delta);
void CreateAmulet(Point position, int lvl, bool sendmsg, bool delta);
void CreateMagicWeapon(Point position, int imisc, int icurs, bool sendmsg, bool delta);
bool GetItemRecord(int nSeed, uint16_t wCI, int nIndex);
void SetItemRecord(int nSeed, uint16_t wCI, int nIndex);

2
Source/miniwin/miniwin.h

@ -45,7 +45,7 @@ bool FetchMessage(tagMSG *lpMsg);
bool TranslateMessage(const tagMSG *lpMsg);
void PushMessage(const tagMSG *lpMsg);
bool PostMessage(uint32_t Msg, int32_t wParam, int32_t lParam);
bool PostMessage(uint32_t type, int32_t wParam, int32_t lParam);
#ifdef _MSC_VER
#define strcasecmp _stricmp

2
Source/msg.h

@ -449,7 +449,7 @@ void NetSendCmdChItem(bool bHiPri, BYTE bLoc);
void NetSendCmdDelItem(bool bHiPri, BYTE bLoc);
void NetSendCmdDItem(bool bHiPri, int ii);
void NetSendCmdDamage(bool bHiPri, uint8_t bPlr, DWORD dwDam);
void NetSendCmdMonDmg(bool bHiPri, uint16_t bMon, DWORD dwDam);
void NetSendCmdMonDmg(bool bHiPri, uint16_t wMon, DWORD dwDam);
void NetSendCmdString(uint32_t pmask, const char *pszStr);
void delta_close_portal(int pnum);
DWORD ParseCmd(int pnum, TCmd *pCmd);

2
Source/objects.h

@ -66,7 +66,7 @@ void GetRndObjLoc(int randarea, int *xx, int *yy);
void AddMushPatch();
void AddSlainHero();
void objects_44D8C5(_object_id ot, int v2, int ox, int oy);
void objects_44DA68(int a1, int a2);
void objects_44DA68(int i, int a2);
void objects_454AF0(int a1, int a2, int a3);
void AddObject(_object_id ot, int ox, int oy);
void Obj_Trap(int i);

10
Source/player.cpp

@ -849,12 +849,12 @@ void SetPlrAnims(PlayerStruct &player)
/**
* @param c The hero class.
*/
void CreatePlayer(int pnum, HeroClass c)
void CreatePlayer(int playerId, HeroClass c)
{
if ((DWORD)pnum >= MAX_PLRS) {
app_fatal("CreatePlayer: illegal player %i", pnum);
if ((DWORD)playerId >= MAX_PLRS) {
app_fatal("CreatePlayer: illegal player %i", playerId);
}
auto &player = plr[pnum];
auto &player = plr[playerId];
player.Reset();
SetRndSeed(SDL_GetTicks());
@ -1010,7 +1010,7 @@ void CreatePlayer(int pnum, HeroClass c)
player.wReflections = 0;
InitDungMsgs(player);
CreatePlrItems(pnum);
CreatePlrItems(playerId);
SetRndSeed(0);
}

2
Source/utils/soundsample.h

@ -43,7 +43,7 @@ public:
* @param dwBytes Length of buffer
* @return 0 on success, -1 otherwise
*/
int SetChunk(ArraySharedPtr<std::uint8_t> file_data, std::size_t dwBytes);
int SetChunk(ArraySharedPtr<std::uint8_t> fileData, std::size_t dwBytes);
#endif
#ifndef STREAM_ALL_AUDIO

Loading…
Cancel
Save