From 4c9da6dc09e79654948b64ba600c4d4b1b12109e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Sat, 6 Nov 2010 10:17:41 +0000 Subject: [PATCH] Applied patch by kaliber from ticket #6349. which fixes quite a few warnings. Thanks! I did not apply the hunks about moving a logging function in the common accelerant code to be static. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39320 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/graphics/ati/DriverInterface.h | 2 +- src/add-ons/accelerants/3dfx/accelerant.h | 2 +- src/add-ons/accelerants/ati/accelerant.h | 2 +- src/add-ons/accelerants/ati/rage128_dpms.cpp | 4 ++-- src/add-ons/accelerants/ati/rage128_init.cpp | 8 ++++---- src/add-ons/accelerants/ati/rage128_mode.cpp | 6 +++--- src/add-ons/kernel/bus_managers/firewire/firewire.c | 3 +++ .../inbound_filters/spam_filter/SpamFilterConfig.cpp | 6 +++--- .../media/media-add-ons/firewire_dv/FireWireCard.cpp | 2 +- .../media/media-add-ons/opensound/OpenSoundAddOn.cpp | 4 ++-- .../media/media-add-ons/opensound/OpenSoundAddOn.h | 2 +- .../media/media-add-ons/opensound/OpenSoundNode.cpp | 8 ++++---- src/apps/soundrecorder/TrackSlider.cpp | 4 ++-- src/apps/soundrecorder/TrackSlider.h | 2 +- 14 files changed, 29 insertions(+), 26 deletions(-) diff --git a/headers/private/graphics/ati/DriverInterface.h b/headers/private/graphics/ati/DriverInterface.h index 249adc4ee2..48138563f8 100644 --- a/headers/private/graphics/ati/DriverInterface.h +++ b/headers/private/graphics/ati/DriverInterface.h @@ -145,7 +145,7 @@ struct R128_RAMSpec { // All values in XCLKS int readToWriteDelay; // Read to Write Delay int loopLatency; // Loop Latency int loopFudgeFactor; // Add to memReadLatency to get loopLatency - char *name; + const char *name; }; diff --git a/src/add-ons/accelerants/3dfx/accelerant.h b/src/add-ons/accelerants/3dfx/accelerant.h index 32551da0fb..09760aed8f 100644 --- a/src/add-ons/accelerants/3dfx/accelerant.h +++ b/src/add-ons/accelerants/3dfx/accelerant.h @@ -185,7 +185,7 @@ void TDFX_WaitForIdle(); // Write a value to an 32-bit reg using a mask. The mask selects the // bits to be modified. #define OUTREGM(addr, value, mask) \ - (OUTREG(addr, (INREG(addr) & ~mask) | (value & mask))) + (OUTREG(addr, (INREG(addr) & ~(mask)) | ((value) & (mask)))) #endif // _ACCELERANT_H diff --git a/src/add-ons/accelerants/ati/accelerant.h b/src/add-ons/accelerants/ati/accelerant.h index 5291b90c54..c32ea0db1c 100644 --- a/src/add-ons/accelerants/ati/accelerant.h +++ b/src/add-ons/accelerants/ati/accelerant.h @@ -202,7 +202,7 @@ void Rage128_SetFunctionPointers(void); // Write a value to an 32-bit reg using a mask. The mask selects the // bits to be modified. #define OUTREGM(addr, value, mask) \ - (OUTREG(addr, (INREG(addr) & ~mask) | (value & mask))) + (OUTREG(addr, (INREG(addr) & ~(mask)) | ((value) & (mask)))) #endif // _ACCELERANT_H diff --git a/src/add-ons/accelerants/ati/rage128_dpms.cpp b/src/add-ons/accelerants/ati/rage128_dpms.cpp index 11cec3cb37..41edd9b970 100644 --- a/src/add-ons/accelerants/ati/rage128_dpms.cpp +++ b/src/add-ons/accelerants/ati/rage128_dpms.cpp @@ -72,13 +72,13 @@ Rage128_SetDPMSMode(uint32 dpmsMode) case B_DPMS_STAND_BY: // Screen: Off; HSync: Off, VSync: On. OUTREGM(R128_CRTC_EXT_CNTL, - (R128_CRTC_DISPLAY_DIS | R128_CRTC_HSYNC_DIS), mask); + R128_CRTC_DISPLAY_DIS | R128_CRTC_HSYNC_DIS, mask); break; case B_DPMS_SUSPEND: // Screen: Off; HSync: On, VSync: Off. OUTREGM(R128_CRTC_EXT_CNTL, - (R128_CRTC_DISPLAY_DIS | R128_CRTC_VSYNC_DIS), mask); + R128_CRTC_DISPLAY_DIS | R128_CRTC_VSYNC_DIS, mask); break; case B_DPMS_OFF: diff --git a/src/add-ons/accelerants/ati/rage128_init.cpp b/src/add-ons/accelerants/ati/rage128_init.cpp index 328e8c0baf..bdb74e28ac 100644 --- a/src/add-ons/accelerants/ati/rage128_init.cpp +++ b/src/add-ons/accelerants/ati/rage128_init.cpp @@ -21,10 +21,10 @@ // Memory Specifications from RAGE 128 Software Development Manual // (Technical Reference Manual P/N SDK-G04000 Rev 0.01), page 3-21. static R128_RAMSpec sRAMSpecs[] = { - { 4, 4, 3, 3, 1, 3, 1, 16, 12, (char *)"128-bit SDR SGRAM 1:1" }, - { 4, 8, 3, 3, 1, 3, 1, 17, 13, (char *)"64-bit SDR SGRAM 1:1" }, - { 4, 4, 1, 2, 1, 2, 1, 16, 12, (char *)"64-bit SDR SGRAM 2:1" }, - { 4, 4, 3, 3, 2, 3, 1, 16, 12, (char *)"64-bit DDR SGRAM" }, + { 4, 4, 3, 3, 1, 3, 1, 16, 12, "128-bit SDR SGRAM 1:1" }, + { 4, 8, 3, 3, 1, 3, 1, 17, 13, "64-bit SDR SGRAM 1:1" }, + { 4, 4, 1, 2, 1, 2, 1, 16, 12, "64-bit SDR SGRAM 2:1" }, + { 4, 4, 3, 3, 2, 3, 1, 16, 12, "64-bit DDR SGRAM" }, }; diff --git a/src/add-ons/accelerants/ati/rage128_mode.cpp b/src/add-ons/accelerants/ati/rage128_mode.cpp index 6134991032..31a316dda6 100644 --- a/src/add-ons/accelerants/ati/rage128_mode.cpp +++ b/src/add-ons/accelerants/ati/rage128_mode.cpp @@ -304,7 +304,7 @@ SetRegisters(DisplayParams& params) OUTREG(R128_CRTC_GEN_CNTL, params.crtc_gen_cntl); - OUTREGM(R128_DAC_CNTL, (R128_DAC_MASK_ALL | R128_DAC_8BIT_EN), + OUTREGM(R128_DAC_CNTL, R128_DAC_MASK_ALL | R128_DAC_8BIT_EN, ~(R128_DAC_RANGE_CNTL | R128_DAC_BLANKING)); OUTREG(R128_CRTC_H_TOTAL_DISP, params.crtc_h_total_disp); @@ -393,7 +393,7 @@ Rage128_SetDisplayMode(const DisplayModeEx& mode) // Select primary monitor and enable 8-bit color. OUTREGM(R128_DAC_CNTL, R128_DAC_8BIT_EN, - (R128_DAC_PALETTE_ACC_CTL | R128_DAC_8BIT_EN)); + R128_DAC_PALETTE_ACC_CTL | R128_DAC_8BIT_EN); OUTREG8(R128_PALETTE_INDEX, 0); // set first color index for (int i = 0; i < 256; i++) @@ -436,7 +436,7 @@ Rage128_SetIndexedColors(uint count, uint8 first, uint8* colorData, uint32 flags // Select primary monitor and enable 8-bit color. OUTREGM(R128_DAC_CNTL, R128_DAC_8BIT_EN, - (R128_DAC_PALETTE_ACC_CTL | R128_DAC_8BIT_EN)); + R128_DAC_PALETTE_ACC_CTL | R128_DAC_8BIT_EN); OUTREG8(R128_PALETTE_INDEX, first); // set first color index while (count--) { diff --git a/src/add-ons/kernel/bus_managers/firewire/firewire.c b/src/add-ons/kernel/bus_managers/firewire/firewire.c index 2a928230fb..799b5ea853 100644 --- a/src/add-ons/kernel/bus_managers/firewire/firewire.c +++ b/src/add-ons/kernel/bus_managers/firewire/firewire.c @@ -1096,8 +1096,11 @@ static struct fw_xfer * fw_tl2xfer(struct firewire_comm *fc, int node, int tlabel, int tcode) { struct fw_xfer *xfer; + int s; int req; + s = splfw(); + mtx_lock(&fc->tlabel_lock); STAILQ_FOREACH(xfer, &fc->tlabels[tlabel], tlabel) if(xfer->send.hdr.mode.hdr.dst == node) { diff --git a/src/add-ons/mail_daemon/inbound_filters/spam_filter/SpamFilterConfig.cpp b/src/add-ons/mail_daemon/inbound_filters/spam_filter/SpamFilterConfig.cpp index 282ba9dc00..1d90a15879 100644 --- a/src/add-ons/mail_daemon/inbound_filters/spam_filter/SpamFilterConfig.cpp +++ b/src/add-ons/mail_daemon/inbound_filters/spam_filter/SpamFilterConfig.cpp @@ -167,7 +167,7 @@ void AGMSBayesianSpamFilterConfig::AttachedToWindow () { char numberString [30]; BRect tempRect; - char *tempStringPntr; + const char *tempStringPntr; SetViewColor (ui_color (B_PANEL_BACKGROUND_COLOR)); @@ -209,7 +209,7 @@ void AGMSBayesianSpamFilterConfig::AttachedToWindow () tempRect.right = fNoWordsMeansSpamCheckBoxPntr->Frame().left - be_plain_font->StringWidth ("a"); - tempStringPntr = (char *)"Spam above:"; + tempStringPntr = "Spam above:"; sprintf (numberString, "%06.4f", (double) fSpamCutoffRatio); fSpamCutoffRatioTextBoxPntr = new BTextControl ( tempRect, @@ -228,7 +228,7 @@ void AGMSBayesianSpamFilterConfig::AttachedToWindow () // Add the box displaying the genuine cutoff ratio, on a line by itself. - tempStringPntr = (char *)"Genuine below and uncertain above:"; + tempStringPntr = "Genuine below and uncertain above:"; sprintf (numberString, "%08.6f", (double) fGenuineCutoffRatio); fGenuineCutoffRatioTextBoxPntr = new BTextControl ( tempRect, diff --git a/src/add-ons/media/media-add-ons/firewire_dv/FireWireCard.cpp b/src/add-ons/media/media-add-ons/firewire_dv/FireWireCard.cpp index 00bc261af5..13f58e94d7 100644 --- a/src/add-ons/media/media-add-ons/firewire_dv/FireWireCard.cpp +++ b/src/add-ons/media/media-add-ons/firewire_dv/FireWireCard.cpp @@ -75,7 +75,7 @@ struct frac pad_rate[2] = { {203, 2997}, /* = (8000 - 29.97 * 250)/(29.97 * 250) */ {1, 15}, /* = (8000 - 25 * 300)/(25 * 300) */ }; -char *system_name[] = {(char *)"NTSC", (char *)"PAL"}; +const char *system_name[] = {"NTSC", "PAL"}; int frame_rate[] = {30, 25}; #define DV_PSIZE 512 diff --git a/src/add-ons/media/media-add-ons/opensound/OpenSoundAddOn.cpp b/src/add-ons/media/media-add-ons/opensound/OpenSoundAddOn.cpp index 1729c19539..a8c63f39d4 100644 --- a/src/add-ons/media/media-add-ons/opensound/OpenSoundAddOn.cpp +++ b/src/add-ons/media/media-add-ons/opensound/OpenSoundAddOn.cpp @@ -64,7 +64,7 @@ OpenSoundAddOn::OpenSoundAddOn(image_id image) : fInitCheckStatus = B_NO_INIT; /* unix paths */ - if (RecursiveScan((char *)"/dev/oss/") != B_OK) + if (RecursiveScan("/dev/oss/") != B_OK) return; /* if (RecursiveScan("/dev/audio/oss/") != B_OK) @@ -193,7 +193,7 @@ status_t OpenSoundAddOn::AutoStart( } status_t -OpenSoundAddOn::RecursiveScan(char* rootPath, BEntry *rootEntry) +OpenSoundAddOn::RecursiveScan(const char* rootPath, BEntry *rootEntry) { status_t err; int mixer; diff --git a/src/add-ons/media/media-add-ons/opensound/OpenSoundAddOn.h b/src/add-ons/media/media-add-ons/opensound/OpenSoundAddOn.h index b579e4581d..fea075c9d0 100644 --- a/src/add-ons/media/media-add-ons/opensound/OpenSoundAddOn.h +++ b/src/add-ons/media/media-add-ons/opensound/OpenSoundAddOn.h @@ -53,7 +53,7 @@ class OpenSoundAddOn : /************************/ private: - status_t RecursiveScan(char* path, BEntry *rootEntry = NULL); + status_t RecursiveScan(const char* path, BEntry *rootEntry = NULL); void SaveSettings(void); void LoadSettings(void); diff --git a/src/add-ons/media/media-add-ons/opensound/OpenSoundNode.cpp b/src/add-ons/media/media-add-ons/opensound/OpenSoundNode.cpp index ed9b026227..d8f76931b4 100644 --- a/src/add-ons/media/media-add-ons/opensound/OpenSoundNode.cpp +++ b/src/add-ons/media/media-add-ons/opensound/OpenSoundNode.cpp @@ -485,9 +485,9 @@ OpenSoundNode::NodeRegistered() mediaInput.destination.port = ControlPort(); mediaInput.destination.id = fInputs.CountItems(); mediaInput.node = Node(); - char *prefix = (char *)""; + const char *prefix = ""; if (strstr(engine->Info()->name, "SPDIF")) - prefix = (char *)"S/PDIF "; + prefix = "S/PDIF "; sprintf(mediaInput.name, "%sOutput %ld (%s)", prefix, mediaInput.destination.id, gSupportedFormatsNames[f]); @@ -533,9 +533,9 @@ OpenSoundNode::NodeRegistered() mediaOutput.source.port = ControlPort(); mediaOutput.source.id = fOutputs.CountItems(); mediaOutput.node = Node(); - char *prefix = (char *)""; + const char *prefix = ""; if (strstr(engine->Info()->name, "SPDIF")) - prefix = (char *)"S/PDIF "; + prefix = "S/PDIF "; sprintf(mediaOutput.name, "%sInput %ld (%s)", prefix, mediaOutput.source.id, gSupportedFormatsNames[f]); diff --git a/src/apps/soundrecorder/TrackSlider.cpp b/src/apps/soundrecorder/TrackSlider.cpp index 814205dc89..34e92e576b 100644 --- a/src/apps/soundrecorder/TrackSlider.cpp +++ b/src/apps/soundrecorder/TrackSlider.cpp @@ -75,7 +75,7 @@ TrackSlider::_InitBitmap() fBitmap = new BBitmap(rect, BScreen().ColorSpace(), true); - fBitmapView = new SliderOffscreenView(rect.OffsetToSelf(B_ORIGIN), (char *)"bitmapView"); + fBitmapView = new SliderOffscreenView(rect.OffsetToSelf(B_ORIGIN), "bitmapView"); fBitmap->AddChild(fBitmapView); fBitmapView->fRight = Bounds().right - kLeftRightTrackSliderWidth; @@ -477,7 +477,7 @@ TrackSlider::FrameResized(float width, float height) } -SliderOffscreenView::SliderOffscreenView(BRect frame, char *name) +SliderOffscreenView::SliderOffscreenView(BRect frame, const char *name) : BView(frame, name, B_FOLLOW_LEFT | B_FOLLOW_TOP, B_WILL_DRAW), leftBitmap(BRect(BPoint(0,0), kLeftRightTrackSliderSize), B_CMAP8), rightBitmap(BRect(BPoint(0,0), kLeftRightTrackSliderSize), B_CMAP8), diff --git a/src/apps/soundrecorder/TrackSlider.h b/src/apps/soundrecorder/TrackSlider.h index 3564cafe75..6b7ab5edce 100644 --- a/src/apps/soundrecorder/TrackSlider.h +++ b/src/apps/soundrecorder/TrackSlider.h @@ -14,7 +14,7 @@ class SliderOffscreenView : public BView { public: - SliderOffscreenView(BRect frame, char *name); + SliderOffscreenView(BRect frame, const char *name); virtual ~SliderOffscreenView(); virtual void DrawX();