From ecc2961bee0533d1951ce2eab54d2c1e87e87e02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Wed, 8 Jun 2005 01:23:44 +0000 Subject: [PATCH] Fixed warnings and the build. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13000 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/game/Jamfile | 2 +- src/kits/game/SimpleGameSound.cpp | 30 ++++++++++++++++-------------- src/kits/game/WindowScreen.cpp | 7 +++++-- 3 files changed, 22 insertions(+), 17 deletions(-) diff --git a/src/kits/game/Jamfile b/src/kits/game/Jamfile index 8318ca494e..58105a01bb 100644 --- a/src/kits/game/Jamfile +++ b/src/kits/game/Jamfile @@ -32,7 +32,7 @@ SharedLibrary game : LinkSharedOSLibs libgame.so : - be libmedia.so + libbe.so libmedia.so ; MakeLocate libgame.so : $(OBOS_STLIB_DIR) ; diff --git a/src/kits/game/SimpleGameSound.cpp b/src/kits/game/SimpleGameSound.cpp index 79dd3c5645..50eda18348 100644 --- a/src/kits/game/SimpleGameSound.cpp +++ b/src/kits/game/SimpleGameSound.cpp @@ -1,5 +1,5 @@ //------------------------------------------------------------------------------ -// Copyright (c) 2001-2002, OpenBeOS +// Copyright (c) 2001-2005, Haiku // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), @@ -77,15 +77,17 @@ BSimpleGameSound::BSimpleGameSound(const BSimpleGameSound &other) : BGameSound(other) { gs_audio_format format; - void * data; - + void *data = NULL; + status_t error = other.Device()->Buffer(other.ID(), &format, data); - if (error != B_OK) SetInitError(error); - + if (error != B_OK) + SetInitError(error); + Init(data, 0, &format); free(data); } - + + BSimpleGameSound::~BSimpleGameSound() { } @@ -95,16 +97,16 @@ BGameSound * BSimpleGameSound::Clone() const { gs_audio_format format; - void * data; - + void *data = NULL; + status_t error = Device()->Buffer(ID(), &format, data); - if (error != B_OK) return NULL; - - BSimpleGameSound * clone = new BSimpleGameSound(data, 0, &format, Device()); - + if (error != B_OK) + return NULL; + + BSimpleGameSound *clone = new BSimpleGameSound(data, 0, &format, Device()); free(data); - - return clone; + + return clone; } diff --git a/src/kits/game/WindowScreen.cpp b/src/kits/game/WindowScreen.cpp index c62fe240d0..7081e1ba93 100644 --- a/src/kits/game/WindowScreen.cpp +++ b/src/kits/game/WindowScreen.cpp @@ -718,9 +718,11 @@ BWindowScreen::CalcFrame(int32 index, int32 space, display_mode *dmode) int32 BWindowScreen::SetFullscreen(int32 enable) { - int32 result = -1, retval = -1; + int32 retval = -1; #ifdef COMPILE_FOR_R5 + int32 result = -1 + a_session->swrite_l(WS_SET_FULLSCREEN); a_session->swrite_l(server_token); a_session->swrite_l(enable); @@ -820,9 +822,10 @@ BWindowScreen::SetActiveState(int32 state) if (status == B_OK) { be_app->ShowCursor(); if (activate_state) { - const color_map *colorMap = system_colors(); #ifdef COMPILE_FOR_R5 + const color_map *colorMap = system_colors(); _BAppServerLink_ link; + link.fSession->swrite_l(WS_SET_PALETTE); link.fSession->swrite_l(screen_index); link.fSession->swrite_l(0);