From b3a64dc0c6db8c2f2a6faf5e3d2cd11c81713114 Mon Sep 17 00:00:00 2001
From: Bjørn Lindeijer <bjorn@lindeijer.nl>
Date: Thu, 8 Sep 2005 22:48:48 +0000
Subject: Removed inclusion of malloc.h header as it doens't seem necessary and
 was problematic on FreeBSD.

---
 ChangeLog               | 17 +++++++++++------
 src/game.cpp            |  6 ++++--
 src/graphics.h          | 13 ++++++++++---
 src/gui/char_server.cpp | 29 ++++++++++++++++++++---------
 src/main.cpp            |  3 ++-
 src/net/win2linux.h     |  3 ---
 6 files changed, 47 insertions(+), 24 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 96ad453c..b50458c8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-09-09  Bj�rn Lindeijer  <bjorn@lindeijer.nl>
+
+	* src/net/win2linux.h: Removed inclusion of malloc.h header as it
+	doens't seem necessary and was problematic on FreeBSD.
+
 2005-09-08  Bj�rn Steinbrink  <B.Steinbrink@gmx.de>
 
 	* src/game.cpp: Clean the floor items when the map changes.
@@ -5,10 +10,10 @@
 2005-08-30  Eugenio Favalli  <elvenprogrammer@gmail.com>
 
 	* README, The Mana World.dev, data/graphics/sprites/items.png,
-	data/graphics/sprites/npcs.png, data/help/header.txt, data/help/skills.txt,
-	data/items.xml, data/maps/new_8-1.tmx.gz: Updated docs for release, fixed
-	Dev-Cpp project file, added more items and npcs, fixed the new map and
-	added it to the makefile.
+	data/graphics/sprites/npcs.png, data/help/header.txt,
+	data/help/skills.txt, data/items.xml, data/maps/new_8-1.tmx.gz:
+	Updated docs for release, fixed Dev-Cpp project file, added more items
+	and npcs, fixed the new map and added it to the makefile.
 
 2005-08-31  Bj�rn Steinbrink  <B.Steinbrink@gmx.de>
 
@@ -19,8 +24,8 @@
 2005-08-30  Eugenio Favalli  <elvenprogrammer@gmail.com>
 
 	* The Mana World.dev: Updated project file.
-	* data/graphics/sprites/npcs.png, src/gui/sell.cpp: Added empty sprite and
-	reorganized spriteset, fixed a typo.
+	* data/graphics/sprites/npcs.png, src/gui/sell.cpp: Added empty sprite
+	and reorganized spriteset, fixed a typo.
 
 2005-08-29  Bj�rn Steinbrink  <B.Steinbrink@gmx.de>
 
diff --git a/src/game.cpp b/src/game.cpp
index 80cec17d..45bc4dce 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -924,7 +924,8 @@ void do_input()
             }
         }
 
-        if (joy[JOY_BTN1]) {
+        if (joy[JOY_BTN1])
+        {
             unsigned short x = player_node->x;
             unsigned short y = player_node->y;
             int id = find_floor_item_by_cor(x, y);
@@ -936,7 +937,8 @@ void do_input()
                 WFIFOSET(6);
             }
         }
-        else if (joy[JOY_BTN2] && action_time) {
+        else if (joy[JOY_BTN2] && action_time)
+        {
             if (player_node->action == Being::STAND)
                 action(2, 0);
             else if (player_node->action == Being::SIT)
diff --git a/src/graphics.h b/src/graphics.h
index f62662f7..6bd32ec2 100644
--- a/src/graphics.h
+++ b/src/graphics.h
@@ -72,9 +72,16 @@ class Graphics : public gcn::SDLGraphics {
          * @return <code>true</code> if the image was blitted properly
          *         <code>false</code> otherwise.
          */
-        virtual bool drawImage(Image *image, int srcX, int srcY, int dstX, int dstY, int width, int height);
-
-        virtual void drawImagePattern(Image *image, int x, int y, int w, int h);
+        virtual bool
+        drawImage(Image *image,
+                  int srcX, int srcY,
+                  int dstX, int dstY,
+                  int width, int height);
+
+        virtual void
+        drawImagePattern(Image *image,
+                         int x, int y,
+                         int w, int h);
 
         /**
          * Draws a rectangle using images. 4 corner images, 4 side images and 1
diff --git a/src/gui/char_server.cpp b/src/gui/char_server.cpp
index 268cb8bd..24e58c5c 100644
--- a/src/gui/char_server.cpp
+++ b/src/gui/char_server.cpp
@@ -162,14 +162,17 @@ void char_server() {
     delete dialog;
 }
 
-void server_char_server(int serverIndex) {
+void server_char_server(int serverIndex)
+{
     int ret;
     state = LOGIN;
     const char *ipstring = iptostring(server_info[serverIndex].address);
 
     // Connect to char server
     ret = open_session(ipstring, server_info[serverIndex].port);
-    if (ret == SOCKET_ERROR) {
+
+    if (ret == SOCKET_ERROR)
+    {
         std::string str = std::string("Unable to connect to char server ") +
             std::string(ipstring);
         new OkDialog("Error", str);
@@ -185,16 +188,20 @@ void server_char_server(int serverIndex) {
     WFIFOB(16) = net_b_value(sex);
     WFIFOSET(17);
 
-    while ((in_size < 4) || (out_size > 0))flush();
+    while ((in_size < 4) || (out_size > 0)) flush();
     RFIFOSKIP(4);
 
     while (in_size < 3) flush();
 
-    if (RFIFOW(0) == 0x006b) {
-        while(in_size < RFIFOW(2))flush();
+    if (RFIFOW(0) == 0x006b)
+    {
+        while (in_size < RFIFOW(2)) flush();
+
         n_character = (RFIFOW(2) - 24) / 106;
-        char_info = (PLAYER_INFO *)malloc(sizeof(PLAYER_INFO) * n_character);
-        for (int i = 0; i < n_character; i++) {
+        char_info = (PLAYER_INFO*)malloc(sizeof(PLAYER_INFO) * n_character);
+
+        for (int i = 0; i < n_character; i++)
+        {
             int n = 24 + 106 * i;
             char_info[i].id = RFIFOL(n);
             strcpy(char_info[i].name, RFIFOP(n + 74));
@@ -217,6 +224,7 @@ void server_char_server(int serverIndex) {
             char_info[i].hair_color = RFIFOW(n + 70);
             char_info[i].weapon = RFIFOW(n + 56);
         }
+
         state = CHAR_SELECT;
 
         logger->log("CharServer: Player: %s (Packet ID: %x, Length: %d)",
@@ -225,7 +233,8 @@ void server_char_server(int serverIndex) {
 
         RFIFOSKIP(RFIFOW(2));
     }
-    else if (RFIFOW(0) == 0x006c) {
+    else if (RFIFOW(0) == 0x006c)
+    {
         std::string errorStr;
         switch (RFIFOB(2)) {
             case 0: errorStr = "Access denied"; break;
@@ -235,7 +244,9 @@ void server_char_server(int serverIndex) {
         new OkDialog("Error", errorStr);
         RFIFOSKIP(3);
         close_session();
-    } else {
+    }
+    else
+    {
         new OkDialog("Error", "Unknown error");
     }
     // Todo: add other packets
diff --git a/src/main.cpp b/src/main.cpp
index 84e8b73a..7633df71 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -254,7 +254,8 @@ void init_engine()
 
 
     // Try to set the desired video mode
-    if (!graphics->setVideoMode(width, height, bpp, fullscreen, hwaccel)) {
+    if (!graphics->setVideoMode(width, height, bpp, fullscreen, hwaccel))
+    {
         std::cerr << "Couldn't set " << width << "x" << height << "x" <<
             bpp << " video mode: " << SDL_GetError() << std::endl;
         exit(1);
diff --git a/src/net/win2linux.h b/src/net/win2linux.h
index 71737a58..1371f4d9 100644
--- a/src/net/win2linux.h
+++ b/src/net/win2linux.h
@@ -1,8 +1,5 @@
 #include <stdio.h>
 #include <stdlib.h>
-#ifndef MACOSX
-#include <malloc.h>
-#endif
 #include <string.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
-- 
cgit v1.2.3-70-g09d2