Commit 59d7d776 authored by alistert's avatar alistert

Applied some of Fabian Greffrath's patches. Changed file opening code. Minor tidying.

parent 762a7bee
......@@ -63,27 +63,24 @@
#define F100 102400
#define F160 163840
// File names
#ifdef __SYMBIAN32__
#ifdef UIQ3
#define CONFIG_FILE "c:\\shared\\openjazz\\openjazz.cfg"
#define LOGO_FILE "c:\\shared\\openjazz\\openjazz.000"
#else
#define CONFIG_FILE "c:\\data\\openjazz\\openjazz.cfg"
#define LOGO_FILE "c:\\data\\openjazz\\openjazz.000"
#endif
#else
// Files
#define CONFIG_FILE "openjazz.cfg"
#define LOGO_FILE "openjazz.000"
#endif
#define LEVEL_FILE "openjazz.tmp"
#ifdef UPPERCASE_FILENAMES
#define F_MAINCHAR "MAINCHAR.000"
#define F_MENU "MENU.000"
#define F_PANEL "PANEL.000"
#define F_SOUNDS "SOUNDS.000"
// File name formats
#define F_STARTUP_0SC "STARTUP.0SC"
#define F_END_0SC "END.0SC"
#define F_MACRO "MACRO.2"
// File path prefixes
#define F_BLOCKS "BLOCKS"
#define F_LEVEL "LEVEL"
#define F_PLANET "PLANET"
......@@ -92,8 +89,14 @@
#define F_MAINCHAR "mainchar.000"
#define F_MENU "menu.000"
#define F_PANEL "panel.000"
#define F_SOUNDS "sounds.000"
#define F_STARTUP_0SC "startup.0sc"
#define F_END_0SC "end.0sc"
#define F_MACRO "macro.2"
// File name formats
// File path prefixes
#define F_BLOCKS "blocks"
#define F_LEVEL "level"
#define F_PLANET "planet"
......@@ -161,17 +164,17 @@ EXTERN int loop (int type);
// Functions in util.cpp
EXTERN bool fileExists (char *fileName);
EXTERN char * createString (char *string);
EXTERN char * createString (char *first, char *second);
EXTERN char * createFileName (char *type, int extension);
EXTERN char * createFileName (char *type, char *extension);
EXTERN char * createFileName (char *type, int level, int extension);
EXTERN char * createEditableString (char *string);
EXTERN void log (char *message);
EXTERN void log (char *message, char *detail);
EXTERN void log (char *message, int number);
EXTERN void logError (char *message, char *detail);
EXTERN bool fileExists (const char *fileName);
EXTERN char * createString (const char *string);
EXTERN char * createString (const char *first, const char *second);
EXTERN char * createFileName (const char *type, int extension);
EXTERN char * createFileName (const char *type, const char *extension);
EXTERN char * createFileName (const char *type, int level, int extension);
EXTERN char * createEditableString (const char *string);
EXTERN void log (const char *message);
EXTERN void log (const char *message, const char *detail);
EXTERN void log (const char *message, int number);
EXTERN void logError (const char *message, const char *detail);
#endif
......@@ -25,57 +25,60 @@
#include "io/gfx/video.h"
File::File (char * fileName, bool write) {
File::File (const char * name, bool write) {
// Open the file from the current directory
f = fopen(fileName, write ? "wb": "rb");
// Open the file from the user's directory
if (open(userPath, name, write)) return;
// If that succeeded, done
if (f) {
// Open the file from the OpenJazz directory
if (open(ojPath, name, write)) return;
//log("Opened file", fileName);
// Open the file from the game directory
if (open(gamePath, name, write)) return;
filePath = createString(fileName);
log("Could not open file", name);
return;
throw E_FILE;
}
}
// Create the file path
filePath = createString(path, fileName);
// Open the file from the path
f = fopen(filePath, write ? "wb": "rb");
File::~File () {
if (f == NULL) {
fclose(f);
log("Could not open file", fileName);
//log("Closed file", filePath);
delete[] filePath;
throw E_FILE;
return;
}
}
//log("Opened file", filePath);
return;
bool File::open (const char * path, const char * name, bool write) {
}
// Create the file path for the given directory
filePath = createString(path, name);
// Open the file from the path
f = fopen(filePath, write ? "wb": "rb");
File::~File () {
if (f) {
fclose(f);
//log("Opened file", filePath);
//log("Closed file", filePath);
return true;
}
delete[] filePath;
return;
return false;
}
int File::getSize () {
int pos, size;
......
......@@ -30,7 +30,7 @@
#include <stdio.h>
// Class
// Classes
class File {
......@@ -38,8 +38,10 @@ class File {
FILE *f;
char *filePath;
bool open (const char * path, const char * name, bool write);
public:
File (char * fileName, bool write);
File (const char * name, bool write);
~File ();
int getSize ();
......@@ -61,10 +63,12 @@ class File {
};
//Variable
// Variables
// Path to game data
EXTERN char *path;
// Paths to files
EXTERN char *userPath;
EXTERN char *ojPath;
EXTERN char *gamePath;
#endif
......@@ -33,7 +33,7 @@
#include <string.h>
Font::Font (char * fileName) {
Font::Font (const char * fileName) {
File *file;
unsigned char *pixels, *character;
......@@ -314,7 +314,7 @@ Font::~Font () {
int Font::showString (char * s, int x, int y) {
int Font::showString (const char * s, int x, int y) {
SDL_Rect src, dst;
unsigned int count;
......@@ -466,27 +466,41 @@ void Font::restorePalette () {
}
int Font::calcStringWidth(char *s)
{
int Font::getHeight () {
return h;
}
int Font::getStringWidth (const char *string) {
int count;
int stringwidth = 0;
int stringWidth = 0;
// Go through each character of the string
for (count = 0; s[count]; count++) {
for (count = 0; string[count]; count++) {
if (s[count] == '\n') {
if (string[count] == '\n') {
} else {
int width = w[(int)(map[(int)(s[count])])];
if(s[count] == 32) {
width = width/2;
}
int width = w[(int)(map[(int)(string[count])])];
if (string[count] == ' ') {
width = width >> 1;
stringwidth += (width-1);
}
stringWidth += width - 1;
}
return stringwidth;
}
return stringWidth;
}
......@@ -42,17 +42,17 @@ class Font {
char map[128]; // Maps ASCII values to letter positions
public:
Font (char *fileName);
Font (const char *fileName);
Font (File *file, bool big);
~Font ();
int showString (char *s, int x, int y);
int showString (const char *s, int x, int y);
void showNumber (int n, int x, int y);
void mapPalette (int start, int length, int newStart,
int newLength);
void restorePalette ();
int fontHeight() { return h; }
int calcStringWidth(char *s);
int getHeight ();
int getStringWidth (const char *string);
};
// Variables
......
......@@ -113,7 +113,7 @@ void openAudio () {
// Load sounds
if (loadSounds("sounds.000") != E_NONE) sounds = NULL;
if (loadSounds(F_SOUNDS) != E_NONE) sounds = NULL;
return;
......@@ -133,7 +133,7 @@ void closeAudio () {
}
void playMusic (char * fileName) {
void playMusic (const char * fileName) {
#ifdef USE_MODPLUG
......@@ -234,7 +234,7 @@ void stopMusic () {
}
int loadSounds (char *fileName) {
int loadSounds (const char *fileName) {
File *file;
unsigned char *clip;
......
......@@ -74,9 +74,9 @@ EXTERN int nSounds;
EXTERN void openAudio ();
EXTERN void closeAudio ();
EXTERN void playMusic (char *fileName);
EXTERN void playMusic (const char *fileName);
EXTERN void stopMusic ();
EXTERN int loadSounds (char *fileName);
EXTERN int loadSounds (const char *fileName);
EXTERN void freeSounds ();
EXTERN void playSound (int sound);
......
......@@ -37,7 +37,7 @@
#include "player/player.h"
DemoLevel::DemoLevel (char *fileName) {
DemoLevel::DemoLevel (const char *fileName) {
File *file;
char *levelFile;
......
......@@ -551,7 +551,7 @@ void Level::timeCalcs (bool paused) {
int Level::play () {
char *options[5] = {"continue game", "save game", "load game",
const char *options[5] = {"continue game", "save game", "load game",
"setup options", "quit game"};
PaletteEffect *levelPE;
char *string;
......
......@@ -181,7 +181,7 @@ class DemoLevel : public Level {
unsigned char *macro;
public:
DemoLevel (char *fileName);
DemoLevel (const char *fileName);
~DemoLevel ();
int play ();
......
......@@ -43,6 +43,7 @@
#include "level/level.h"
#include "menu/menu.h"
#include "player/player.h"
#include "scene.h"
#include <string.h>
......@@ -555,14 +556,25 @@ int main(int argc, char *argv[]) {
/*
Scene *scene;
*/
int count;
// Find path
if (argc < 2) {
// Determine user path
// No path was given, use the path of the program
#ifdef HOMEDIR
#ifdef WIN32
userPath = createString(getenv("HOME"), "\\");
#else
userPath = createString(getenv("HOME"), "/.");
#endif
#else
userPath = createString("");
#endif
int count;
// Determine OpenJazz path
// Use the path of the program, if available
count = strlen(argv[0]) - 1;
......@@ -573,39 +585,51 @@ int main(int argc, char *argv[]) {
while ((argv[0][count] != '/') && (count >= 0)) count--;
#endif
path = new char[count + 2];
// If a directory was found, copy it to the path
if (count >= 0) {
memcpy(path, argv[0], count + 1);
path[count + 1] = 0;
ojPath = new char[count + 2];
memcpy(ojPath, argv[0], count + 1);
ojPath[count + 1] = 0;
} else path[0] = 0;
} else ojPath = createString("");
} else {
// Determine game path
#ifdef DATAPATH
gamePath = createString(DATAPATH);
#elseifdef __SYMBIAN32__
#ifdef UIQ3
gamePath = createString("c:\\shared\\openjazz\\");
#else
gamePath = createString("c:\\data\\openjazz\\");
#endif
#else
if (argc >= 2) {
// Copy the provided path, appending a directory separator as necessary
#ifdef WIN32
#ifdef WIN32
if (argv[1][strlen(argv[1]) - 1] != '\\') {
#else
gamePath = createString(argv[1], "\\");
#else
if (argv[1][strlen(argv[1]) - 1] != '/') {
#endif
#ifdef WIN32
path = createString(argv[1], "\\");
#else
path = createString(argv[1], "/");
#endif
gamePath = createString(argv[1], "/");
#endif
} else {
path = createString(argv[1]);
gamePath = createString(argv[1]);
}
}
} else gamePath = createString("");
#endif
// Initialise SDL
......@@ -625,7 +649,9 @@ int main(int argc, char *argv[]) {
if (loadMain() != E_NONE) {
SDL_Quit();
delete[] path;
delete[] ojPath;
delete[] gamePath;
delete[] userPath;
return -1;
......@@ -633,16 +659,18 @@ int main(int argc, char *argv[]) {
// Show the startup cutscene
/*
try {
scene = new Scene("startup.0sc");
/* try {
scene = new Scene(F_STARTUP_0SC);
} catch (int e) {
freeMain();
SDL_Quit();
delete[] path;
delete[] ojPath;
delete[] gamePath;
delete[] userPath;
return e;
......@@ -662,7 +690,9 @@ int main(int argc, char *argv[]) {
freeMain();
SDL_Quit();
delete[] path;
delete[] ojPath;
delete[] gamePath;
delete[] userPath;
return e;
......@@ -672,17 +702,19 @@ int main(int argc, char *argv[]) {
if (menu->main() == E_NONE) {
// Show the ending cutscene
/*
try {
scene = new Scene("end.0sc");
/* try {
scene = new Scene(F_END_0SC);
} catch (int e) {
delete menu;
freeMain();
SDL_Quit();
delete[] path;
delete[] ojPath;
delete[] gamePath;
delete[] userPath;
return e;
......@@ -703,7 +735,9 @@ int main(int argc, char *argv[]) {
freeMain();
SDL_Quit();
delete[] path;
delete[] ojPath;
delete[] gamePath;
delete[] userPath;
return 0;
......
......@@ -38,7 +38,7 @@
int Menu::newGameDifficulty (int mode, int levelNum, int worldNum) {
char *options[4] = {"easy", "medium", "hard", "turbo"};
const char *options[4] = {"easy", "medium", "hard", "turbo"};
char *firstLevel;
SDL_Rect src, dst;
int count;
......@@ -220,9 +220,9 @@ int Menu::newGameLevel (int mode) {
int Menu::newGameEpisode (int mode) {
char *options[12] = {"episode 1", "episode 2", "episode 3", "episode 4",
"episode 5", "episode 6", "episode a", "episode b", "episode c",
"episode x", "bonus stage", "specific level"};
const char *options[12] = {"episode 1", "episode 2", "episode 3",
"episode 4", "episode 5", "episode 6", "episode a", "episode b",
"episode c", "episode x", "bonus stage", "specific level"};
bool exists[12];
char *check;
SDL_Rect dst;
......
......@@ -40,7 +40,7 @@
int Menu::main () {
char *newGameOptions[6] = {"new single player game", "new co-op game",
const char *newGameOptions[6] = {"new single player game", "new co-op game",
"new battle", "new team battle", "new race", "join game"};
Scene *scene;
SDL_Rect src, dst;
......@@ -189,7 +189,7 @@ int Menu::main () {
try {
level = new DemoLevel("macro.2");
level = new DemoLevel(F_MACRO);
} catch (int e) {
......
......@@ -43,9 +43,9 @@ class Menu {
int episodes;
unsigned char difficulty;
int message (char *text);
int generic (char **optionNames, int options, int *chosen);
int textInput (char *request, char **text);
int message (const char *text);
int generic (const char **optionNames, int options, int *chosen);
int textInput (const char *request, char **text);
int newGameDifficulty (int mode, int levelNum, int worldNum);
int newGameLevel (int mode);
int newGameEpisode (int mode);
......
......@@ -35,7 +35,7 @@
#include <string.h>
int Menu::message (char *text) {
int Menu::message (const char *text) {
// Display a message to the user
......@@ -62,7 +62,7 @@ int Menu::message (char *text) {
}
int Menu::generic (char **optionNames, int options, int *chosen) {
int Menu::generic (const char **optionNames, int options, int *chosen) {
// Let the user select from a menu of the given options
......@@ -112,7 +112,7 @@ int Menu::generic (char **optionNames, int options, int *chosen) {
}
int Menu::textInput (char *request, char **text) {
int Menu::textInput (const char *request, char **text) {
// Let the user to edit a text string
......
......@@ -37,7 +37,7 @@
int Menu::setupKeyboard () {
char *options[7] = {"up", "down", "left", "right", "jump", "fire",
const char *options[7] = {"up", "down", "left", "right", "jump", "fire",
"weapon"};
int progress, count, character;
bool used;
......@@ -122,7 +122,7 @@ int Menu::setupKeyboard () {
int Menu::setupJoystick () {
char *options[7] = {"up", "down", "left", "right", "jump", "fire",
const char *options[7] = {"up", "down", "left", "right", "jump", "fire",
"weapon"};
int progress, count, control;
bool used;
......@@ -428,12 +428,13 @@ int Menu::setupResolution () {
int Menu::setup () {
char *setupOptions[4] = {"character", "keyboard", "joystick", "resolution"};
char *setupCharacterOptions[5] = {"name", "fur", "bandana", "gun",
const char *setupOptions[4] = {"character", "keyboard", "joystick",
"resolution"};
const char *setupCharacterOptions[5] = {"name", "fur", "bandana", "gun",
"wristband"};
char *setupCharacterColOptions[8] = {"white", "red", "orange", "yellow",
"green", "blue", "animation 1", "animation 2"};
unsigned char setupCharacterCols[8] = {PC_WHITE, PC_RED, PC_ORANGE,
const char *setupCharacterColOptions[8] = {"white", "red", "orange",
"yellow", "green", "blue", "animation 1", "animation 2"};
const unsigned char setupCharacterCols[8] = {PC_WHITE, PC_RED, PC_ORANGE,
PC_YELLOW, PC_LGREEN, PC_BLUE, PC_SANIM, PC_LANIM};
int ret;
int option, suboption, subsuboption;
......
......@@ -36,6 +36,8 @@
#include "io/sound.h"
#include "io/gfx/paletteeffects.h"
#include <string.h>
/**
* This is the 0sc format
* Offset, Size (hex), type
......@@ -96,9 +98,11 @@ ScriptText::ScriptText() {
}
ScriptText::~ScriptText() {
free(text);
text = NULL;
}
if (text) delete[] text;
}
ScriptPage::ScriptPage() {
pageTime = 0;
noScriptTexts = 0;
......@@ -108,8 +112,9 @@ ScriptPage::ScriptPage() {
}
ScriptPage::~ScriptPage() {
free(musicfile);
musicfile = NULL;
if (musicfile) delete[] musicfile;
}
void Scene::ParseAni(File* f, int dataIndex) {
......@@ -129,7 +134,7 @@ void Scene::ParseAni(File* f, int dataIndex) {
for(loop = 0;loop<noSounds;loop++) {
char* soundName = f->loadString();
log("Soundname ", soundName);
free(soundName);
delete[] soundName;
}
}
else if(type == 0x4C50) {// PL
......@@ -226,21 +231,26 @@ void Scene::ParseAni(File* f, int dataIndex) {
case 0x5252:
break;
case 0x5b5d:
{
unsigned char header = f->loadChar();
log("PL 5b5d block header", header);
unsigned short int value = f->loadShort();
log("PL 5b5d block value", value);
}
break;
case 0x5453:
{
unsigned char soundIndex = f->loadChar();
unsigned char soundNote = f->loadChar();
unsigned char soundOffset = f->loadChar();
log("PL Audio tag with index", soundIndex);
log("PL Audio tag play at ", soundNote);
log("PL Audio tag play offset ", soundOffset);
}
break;
case 0:
{
int longvalue = f->loadInt();
while(longvalue == 0) {
longvalue = f->loadInt();
......@@ -248,6 +258,7 @@ void Scene::ParseAni(File* f, int dataIndex) {
}
f->seek(-4, false);
value = longvalue;
}
break;
default:
log("PL Read Unknown type", value);
......@@ -336,7 +347,8 @@ void Scene::ParseScripts(File *f) {
int textPosY = -1;
int extraheight = -1;
SDL_Rect textRect = {-1,-1,-1,-1};
SDL_Rect textRect;
bool textRectValid = false;
f->seek(scriptStarts[loop], true); // Seek to data start
if(f->loadChar() == 0x50) { // Script tag
unsigned short int scriptid = f->loadShort();
......@@ -386,7 +398,7 @@ void Scene::ParseScripts(File *f) {
// Music file name
string = f->loadString();
log("ESceneMusic: ", string);
scriptPages[loop].musicfile = strdup(string);
scriptPages[loop].musicfile = createString(string);
delete[] string;
}break;
case ESceneSomethingElse:
......@@ -400,6 +412,7 @@ void Scene::ParseScripts(File *f) {
unsigned short y = textRect.y = f->loadShort();
unsigned short w = textRect.w = (f->loadShort()-x);
unsigned short h = textRect.h = (f->loadShort()-y);
textRectValid = true;
log("Text rectangle xpos:", x);
log("Text rectangle ypos:", y);
log("Text rectangle w:", w);
......@@ -434,7 +447,7 @@ void Scene::ParseScripts(File *f) {
scriptFonts[noScriptFonts].fontId = fontid;
noScriptFonts++;
free(fontname);
delete[] fontname;
}break;
case ESceneTextPosition:
{
......@@ -447,8 +460,10 @@ void Scene::ParseScripts(File *f) {
}
break;
case ESceneTextColour:
{
unsigned short value = f->loadShort();
log("ESceneTextColour", value);
}
break;
case ESceneFontFun:
{
......@@ -578,14 +593,14 @@ void Scene::ParseScripts(File *f) {
}
if(orgdatalen > 0) {
scriptPages[loop].scriptTexts[scriptPages[loop].noScriptTexts].text =(char*) malloc(orgdatalen+1);
scriptPages[loop].scriptTexts[scriptPages[loop].noScriptTexts].text = new char[orgdatalen + 1];
memcpy(scriptPages[loop].scriptTexts[scriptPages[loop].noScriptTexts].text, block, orgdatalen);
scriptPages[loop].scriptTexts[scriptPages[loop].noScriptTexts].text[orgdatalen] = 0;
log("Text data",(char*) scriptPages[loop].scriptTexts[scriptPages[loop].noScriptTexts].text);
}
else {
scriptPages[loop].scriptTexts[scriptPages[loop].noScriptTexts].text =(char*) malloc(1);
scriptPages[loop].scriptTexts[scriptPages[loop].noScriptTexts].text = new char[1];
scriptPages[loop].scriptTexts[scriptPages[loop].noScriptTexts].text[0] = 0;
log("Text data", "Empty line");
}
......@@ -597,11 +612,10 @@ void Scene::ParseScripts(File *f) {
textPosX = -1;
textPosY = -1;
}
if(textRect.x != -1)
if(textRectValid)
{
scriptPages[loop].scriptTexts[scriptPages[loop].noScriptTexts].textRect = textRect;
textRect.x = -1;
textRect.y = -1;
textRectValid = false;
}
if(extraheight != -1)
{
......@@ -611,9 +625,11 @@ void Scene::ParseScripts(File *f) {
scriptPages[loop].noScriptTexts++;
}break;
case ESceneTime:
{
unsigned short int sceneTime = f->loadShort();
log("Scene time",sceneTime&255);
scriptPages[loop].pageTime = sceneTime&255;
}
break;
case ESceneBreaker:
case 0x3e:
......@@ -639,7 +655,7 @@ void Scene::ParseScripts(File *f) {
}
Scene::Scene (char * fileName) {
Scene::Scene (const char * fileName) {
File *file;
int loop;
......@@ -841,17 +857,19 @@ int Scene::play () {
font->showString(scriptPages[sceneIndex].scriptTexts[text].text, textRect.x+x,textRect.y+y);
break;
case 1: // right
int width = font->calcStringWidth(scriptPages[sceneIndex].scriptTexts[text].text);
{
int width = font->getStringWidth(scriptPages[sceneIndex].scriptTexts[text].text);
font->showString(scriptPages[sceneIndex].scriptTexts[text].text, textRect.x+textRect.w-width, textRect.y+y);
}
break;
case 2: // center
{
int width = font->calcStringWidth(scriptPages[sceneIndex].scriptTexts[text].text)/2;
int width = font->getStringWidth(scriptPages[sceneIndex].scriptTexts[text].text)/2;
font->showString(scriptPages[sceneIndex].scriptTexts[text].text, textRect.x+(textRect.w/2)-width,textRect.y+ y);
}
break;
}
y+=(extralineheight+font->fontHeight()/2);
y+=(extralineheight+font->getHeight()/2);
}
}
......
......@@ -23,8 +23,11 @@
#ifndef _SCENE_H
#define _SCENE_H
#include <io/file.h>
#include <sdl.h>
#include <SDL/SDL.h>
enum EScriptFontTypes
{
......@@ -117,7 +120,7 @@ class Scene {
void ParseData(File *f);
void ParseAni(File* f, int dataIndex);
public:
Scene (char * fileName);
Scene (const char * fileName);
~Scene ();
int play ();
......
......@@ -34,7 +34,7 @@
#include <string.h>
bool fileExists (char * fileName) {
bool fileExists (const char * fileName) {
File *file;
......@@ -57,7 +57,7 @@ bool fileExists (char * fileName) {
}
char * createString (char *string) {
char * createString (const char *string) {
char *cloned;
......@@ -69,7 +69,7 @@ char * createString (char *string) {
}
char * createString (char *first, char *second) {
char * createString (const char *first, const char *second) {
char *concatenated;
......@@ -82,7 +82,7 @@ char * createString (char *first, char *second) {
}
char * createFileName (char *type, int extension) {
char * createFileName (const char *type, int extension) {
char *fileName;
int pos;
......@@ -101,7 +101,7 @@ char * createFileName (char *type, int extension) {
}
char * createFileName (char *type, char *extension) {
char * createFileName (const char *type, const char *extension) {
char *fileName;
int pos;
......@@ -117,7 +117,7 @@ char * createFileName (char *type, char *extension) {
}
char * createFileName (char *type, int level, int extension) {
char * createFileName (const char *type, int level, int extension) {
char *fileName;
int pos;
......@@ -137,7 +137,7 @@ char * createFileName (char *type, int level, int extension) {
}
char * createEditableString (char *string) {
char * createEditableString (const char *string) {
char *cloned;
......@@ -149,7 +149,7 @@ char * createEditableString (char *string) {
}
void log (char *message) {
void log (const char *message) {
printf("%s\n", message);
......@@ -158,7 +158,7 @@ void log (char *message) {
}
void log (char *message, char *detail) {
void log (const char *message, const char *detail) {
printf("%s: %s\n", message, detail);
......@@ -167,7 +167,7 @@ void log (char *message, char *detail) {
}
void log (char *message, int number) {
void log (const char *message, int number) {
printf("%s: %d\n", message, number);
......@@ -176,7 +176,7 @@ void log (char *message, int number) {
}
void logError (char *message, char *detail) {
void logError (const char *message, const char *detail) {
fprintf(stderr, "%s: %s\n", message, detail);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment