Some more GCC 4 and PPC fixes.

* Mesa doesn't compile yet, as some PPC specific stuff seems to be
  missing, Philippe?
* Cortex and some other stuff has been marked x86-only, although
  it's more of a "GCC 2.95.3"-only.
* I'm not sure if it's a bug in GCC 4, or if that's what the C
  standard demands, but sizeof(some_type::some_field) is not
  valid anymore :-/


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17515 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2006-05-19 15:52:21 +00:00
parent 8abee6571a
commit b0bc48fbd3
32 changed files with 158 additions and 85 deletions

View File

@ -35,7 +35,7 @@ BEOS_BIN = addattr alert arp basename beep cat catattr chgrp chmod chop chown cl
BEOS_APPS = Terminal Expander People ShowImage Clock Pulse
Playground SoundRecorder BitmapDrawing Magnify DiskProbe AboutHaiku
StyledEdit Installer Chart Workspaces Cortex CortexAddOnHost GLTeapot
StyledEdit Installer Chart Workspaces $(X86_ONLY)Cortex $(X86_ONLY)CortexAddOnHost $(X86_ONLY)GLTeapot
MediaPlayer
;
BEOS_PREFERENCES = Backgrounds DataTranslations FileTypes Fonts Media Menu
@ -44,7 +44,7 @@ BEOS_PREFERENCES = Backgrounds DataTranslations FileTypes Fonts Media Menu
BEOS_SYSTEM_LIB = libbe.so $(HAIKU_LIBSTDC++) libnet.so libmedia.so libtracker.so
libtranslation.so libnetwork.so libbind.so libnetapi.so libsocket.so libdebug.so
libtextencoding.so libz.so libfreetype.so libpng.so libmidi.so libmidi2.so
libdevice.so libgame.so libscreensaver.so libroot.so libmail.so libGL.so
libdevice.so libgame.so libscreensaver.so libroot.so libmail.so $(X86_ONLY)libGL.so
;
BEOS_SYSTEM_SERVERS = registrar debug_server syslog_daemon media_server
media_addon_server input_server app_server fake_app_server midi_server
@ -69,7 +69,7 @@ BEOS_ADD_ONS_MEDIA = mixer.media_addon
#legacy.media_addon
;
BEOS_ADD_ONS_MEDIA_PLUGINS = $(GPL_ONLY)ac3_decoder
aiff_reader au_reader avcodec avi_reader
aiff_reader au_reader $(X86_ONLY)avcodec avi_reader
matroska mov_reader
mp3_decoder mp3_reader
mp4_reader musepack

View File

@ -74,6 +74,8 @@ class BTranslatorRoster : public BArchivable {
status_t StartWatching(BMessenger target);
status_t StopWatching(BMessenger target);
class Private;
private:
// unimplemented
BTranslatorRoster(const BTranslatorRoster& other);
@ -89,7 +91,7 @@ class BTranslatorRoster : public BArchivable {
void _Initialize();
private:
class Private;
friend class Private;
Private* fPrivate;
int32 fUnused[6];

View File

@ -7,12 +7,13 @@
*/
#include "BMPTranslator.h"
#include "BMPView.h"
#include <new>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "BMPView.h"
using std::nothrow;

View File

@ -57,17 +57,17 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Translation Kit required globals
char translatorName[] = "JPEG2000 Images";
char translatorInfo[] = "© 2002-2003, Shard
char translatorInfo[] = "© 2002-2003, Shard\n"
"\n"
"Based on JasPer library:\n"
"© 1999-2000, Image Power, Inc. and\n"
"the University of British Columbia, Canada.\n"
"© 2001-2003 Michael David Adams.\n"
" http://www.ece.uvic.ca/~mdadams/jasper/\n"
"\n"
"ImageMagick's jp2 codec was used as \"tutorial\".\n"
" http://www.imagemagick.org/\n";
Based on JasPer library:
© 1999-2000, Image Power, Inc. and
the University of British Columbia, Canada.
© 2001-2003 Michael David Adams.
http://www.ece.uvic.ca/~mdadams/jasper/
ImageMagick's jp2 codec was used as \"tutorial\".
http://www.imagemagick.org/
";
int32 translatorVersion = 256; // 256 = v1.0.0
// Define the formats we know how to read

View File

@ -126,6 +126,9 @@
#include "jp2_cod.h"
uint_fast32_t jp2_gettypeasoc(int colorspace, int ctype);
/******************************************************************************\
* Functions.
\******************************************************************************/

View File

@ -2,7 +2,7 @@
// SGITranslator
// Written by Stephan Aßmus
// based on TIFFTranslator written mostly by
// Michael Wilber, OBOS Translation Kit Team
// Michael Wilber
//
// SGITranslator.cpp
//
@ -10,7 +10,7 @@
// SGI images.
//
//
// Copyright (c) 2003 OpenBeOS Project
// Copyright (c) 2003-2006 Haiku Project
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
@ -50,6 +50,8 @@
#include "SGITranslator.h"
#include "SGIView.h"
using std::nothrow;
// The input formats that this translator supports.
translation_format gInputFormats[] = {
{

View File

@ -12,6 +12,7 @@
#include <Window.h>
#include <stdio.h>
#include <string.h>
DirectoryRefFilter::DirectoryRefFilter()

View File

@ -13,12 +13,14 @@
#include "DrawingTidbits.h"
#include <math.h>
#include <Bitmap.h>
#include <Debug.h>
#include <Screen.h>
#include <math.h>
#include <string.h>
// ShiftComponent
inline uchar
ShiftComponent(uchar component, float percent)

View File

@ -18,12 +18,17 @@
*
*/
#include "SoundOutput.h"
#include <OS.h>
#include <SoundPlayer.h>
#include <Debug.h>
#include <new>
#include <string.h>
#include "SoundOutput.h"
using std::nothrow;
SoundOutput::SoundOutput(const char *name, const media_multi_audio_format &format)
: fSoundPlayer(new(nothrow) BSoundPlayer(static_cast<const media_raw_audio_format *>(&format), name, play_buffer, NULL, this))

View File

@ -23,6 +23,8 @@
#include "TransportButton.h"
#include "DrawingTidbits.h"
using std::map;
class BitmapStash {
// Bitmap stash is a simple class to hold all the lazily-allocated
// bitmaps that the TransportButton needs when rendering itself.

View File

@ -59,7 +59,7 @@ TransportControlGroup::TransportControlGroup(BRect frame)
{
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
BRect frame(0.0, 0.0, 10.0, 10.0);
frame.Set(0.0, 0.0, 10.0, 10.0);
// Seek Slider
fSeekSlider = new SeekSlider(frame, "seek slider",

View File

@ -12,13 +12,15 @@
#include "VolumeSlider.h"
#include <stdio.h>
#include "ButtonBitmaps.h"
#include "DrawingTidbits.h"
#include <Bitmap.h>
#include <Screen.h>
#include "ButtonBitmaps.h"
#include "DrawingTidbits.h"
#include <stdio.h>
#include <string.h>
// slider colors are hardcoded here, because that's just
// what they currently are within those bitmaps

View File

@ -14,7 +14,6 @@
#include "PulseApp.h"
#include "ConfigView.h"
//#include <Box.h>
#include <Button.h>
#include <TabView.h>
#include <TextControl.h>
@ -23,8 +22,8 @@
#include <stdio.h>
PrefsWindow::PrefsWindow(BRect rect, const char *name, BMessenger *messenger, Prefs *prefs)
: BWindow(rect, name, B_TITLED_WINDOW, B_NOT_RESIZABLE | B_NOT_ZOOMABLE
PrefsWindow::PrefsWindow(BRect frame, const char *name, BMessenger *messenger, Prefs *prefs)
: BWindow(frame, name, B_TITLED_WINDOW, B_NOT_RESIZABLE | B_NOT_ZOOMABLE
| B_NOT_MINIMIZABLE | B_ASYNCHRONOUS_CONTROLS),
fTarget(*messenger),
fPrefs(prefs)

View File

@ -1,5 +1,5 @@
/*
* Copyright 2003-2005, Haiku. All Rights Reserved.
* Copyright 2003-2006, Haiku. All Rights Reserved.
* Distributed under the terms of the MIT license.
*
* Authors:
@ -18,6 +18,7 @@
#include <NodeInfo.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>

View File

@ -184,7 +184,7 @@ BMessage::_InitHeader()
{
DEBUG_FUNCTION_ENTER;
fHeader = (message_header *)malloc(sizeof(message_header));
memset(fHeader, 0, sizeof(message_header) - sizeof(message_header::hash_table));
memset(fHeader, 0, sizeof(message_header) - sizeof(fHeader->hash_table));
fHeader->format = kMessageMagicHaiku;
fHeader->flags = MESSAGE_FLAG_VALID;
@ -227,7 +227,7 @@ BMessage::_Clear()
status_t
BMessage::GetInfo(type_code typeRequested, int32 index, char **nameFound,
type_code *typeFound, int32 *countFound = NULL) const
type_code *typeFound, int32 *countFound) const
{
DEBUG_FUNCTION_ENTER;
if (typeRequested == B_ANY_TYPE) {
@ -647,7 +647,7 @@ BMessage::WasDropped() const
BPoint
BMessage::DropPoint(BPoint *offset = NULL) const
BMessage::DropPoint(BPoint *offset) const
{
DEBUG_FUNCTION_ENTER;
if (offset)

View File

@ -292,6 +292,7 @@ BColorControl::MessageReceived(BMessage *message)
color.red = strtol(fRedText->Text(), NULL, 10);
color.green = strtol(fGreenText->Text(), NULL, 10);
color.blue = strtol(fBlueText->Text(), NULL, 10);
color.alpha = 255;
SetValue(color);
Invoke();
@ -415,8 +416,9 @@ BColorControl::_ColorRamp(BRect rect, BView* target,
{
float width = rect.Width()+1;
rgb_color color;
color.alpha = 255;
target->BeginLineArray(width);
target->BeginLineArray((int32)width);
for (float i = 0; i <= width; i++) {
color.red = (uint8)(i * baseColor.red / width);

View File

@ -12,10 +12,17 @@
*/
#include "ColorConversion.h"
#include <Locker.h>
#include <new.h>
#include <Point.h>
#include <new>
#include <string.h>
using std::nothrow;
namespace BPrivate {
// TODO: system palette -- hard-coded for now, when the app server is ready
@ -632,8 +639,8 @@ ConvertBits(const srcByte *srcBits, dstByte *dstBits, int32 srcBitsLength,
BPoint dstOffset, int32 width, int32 height, bool srcSwap, bool dstSwap,
readFunc *srcFunc, writeFunc *dstFunc)
{
char *srcBitsEnd = (char *)srcBits + srcBitsLength;
char *dstBitsEnd = (char *)dstBits + dstBitsLength;
uint8* srcBitsEnd = (uint8*)srcBits + srcBitsLength;
uint8* dstBitsEnd = (uint8*)dstBits + dstBitsLength;
int32 srcBitsPerRow = srcBytesPerRow << 3;
int32 dstBitsPerRow = dstBytesPerRow << 3;
@ -662,10 +669,10 @@ ConvertBits(const srcByte *srcBits, dstByte *dstBits, int32 srcBitsLength,
dstOffsetY = 0;
}
(char *)srcBits += (srcOffsetY * srcBitsPerRow + srcOffsetX
* srcBitsPerPixel) >> 3;
(char *)dstBits += (dstOffsetY * dstBitsPerRow + dstOffsetX
* dstBitsPerPixel) >> 3;
srcBits = (srcByte*)((uint8*)srcBits + (srcOffsetY * srcBitsPerRow + srcOffsetX
* srcBitsPerPixel >> 3));
dstBits = (dstByte*)((uint8*)dstBits + (dstOffsetY * dstBitsPerRow + dstOffsetX
* dstBitsPerPixel >> 3));
// Ensure that the width fits
int32 srcWidth = (srcBitsPerRow - srcOffsetX * srcBitsPerPixel)
@ -697,10 +704,10 @@ ConvertBits(const srcByte *srcBits, dstByte *dstBits, int32 srcBitsLength,
srcBitsLength -= copyCount;
dstBitsLength -= copyCount;
(char *)srcBits += srcBytesPerRow;
(char *)dstBits += dstBytesPerRow;
srcBits = (srcByte*)((uint8*)srcBits + srcBytesPerRow);
dstBits = (dstByte*)((uint8*)dstBits + dstBytesPerRow);
if ((char *)srcBits > srcBitsEnd || (char *)dstBits > dstBitsEnd)
if ((uint8 *)srcBits > srcBitsEnd || (uint8 *)dstBits > dstBitsEnd)
return B_OK;
}
@ -709,9 +716,9 @@ ConvertBits(const srcByte *srcBits, dstByte *dstBits, int32 srcBitsLength,
int32 srcLinePad = (srcBitsPerRow - width * srcBitsPerPixel) >> 3;
int32 dstLinePad = (dstBitsPerRow - width * dstBitsPerPixel) >> 3;
uint32 result;
uint32 source;
register uint32 result;
register uint32 source;
for (int32 i = 0; i < height; i++) {
for (int32 j = 0; j < width; j++) {
if (srcFunc)
@ -771,12 +778,12 @@ ConvertBits(const srcByte *srcBits, dstByte *dstBits, int32 srcBitsLength,
dstBits++;
}
if ((char *)srcBits > srcBitsEnd || (char *)dstBits > dstBitsEnd)
if ((uint8*)srcBits > srcBitsEnd || (uint8*)dstBits > dstBitsEnd)
return B_OK;
}
(char *)srcBits += srcLinePad;
(char *)dstBits += dstLinePad;
srcBits = (srcByte*)((uint8*)srcBits + srcLinePad);
dstBits = (dstByte*)((uint8*)dstBits + dstLinePad);
dstOffsetX -= width;
srcOffsetX -= width;
}
@ -901,7 +908,7 @@ ConvertBits(const srcByte *srcBits, void *dstBits, int32 srcBitsLength,
break;
case B_CMAP8:
palette_converter();
BPrivate::palette_converter();
ConvertBits(srcBits, (uint8 *)dstBits, srcBitsLength,
dstBitsLength, redShift - 15, greenShift - 10, blueShift - 5,
0, 0, 0x7c00, 0x03e0, 0x001f, 0x0000, srcBytesPerRow,

View File

@ -3459,7 +3459,7 @@ BView::MoveTo(float x, float y)
_FlushIfNotInTransaction();
}
_MoveTo(x, y);
_MoveTo((int32)x, (int32)y);
}
@ -3494,7 +3494,7 @@ BView::ResizeBy(float deltaWidth, float deltaHeight)
_FlushIfNotInTransaction();
}
_ResizeBy(deltaWidth, deltaHeight);
_ResizeBy((int32)deltaWidth, (int32)deltaHeight);
}
@ -4118,7 +4118,7 @@ BView::_ParentResizedBy(int32 x, int32 y)
if (newFrame.LeftTop() != fParentOffset) {
// move view
_MoveTo(roundf(newFrame.left), roundf(newFrame.top));
_MoveTo(lroundf(newFrame.left), lroundf(newFrame.top));
}
if (newFrame != Frame()) {

View File

@ -39,6 +39,37 @@ SubDirCcFlags
-DUSE_3DNOW_ASM
-DUSE_SSE_ASM ;
local archSources ;
if $(TARGET_ARCH) = x86 {
archSources =
common_x86_asm.S
x86_xform2.S
x86_xform3.S
x86_xform4.S
x86_cliptest.S
mmx_blend.S
3dnow_xform1.S
3dnow_xform2.S
3dnow_xform3.S
3dnow_xform4.S
3dnow_normal.S
sse_xform1.S
sse_xform2.S
sse_xform3.S
sse_xform4.S
sse_normal.S
read_rgba_span_x86.S
# tnl
t_vtx_x86_gcc.S
;
} else {
archSources =
t_vtx_generic.c
;
}
StaticLibrary libmesa.a :
# main
@ -198,29 +229,8 @@ StaticLibrary libmesa.a :
# ppc
common_ppc.c
# TODO: check if $(TARGET_ARCH) == x86?
# x86
common_x86_asm.S
x86_xform2.S
x86_xform3.S
x86_xform4.S
x86_cliptest.S
mmx_blend.S
3dnow_xform1.S
3dnow_xform2.S
3dnow_xform3.S
3dnow_xform4.S
3dnow_normal.S
sse_xform1.S
sse_xform2.S
sse_xform3.S
sse_xform4.S
sse_normal.S
read_rgba_span_x86.S
$(archSources)
# tnl
t_vtx_x86_gcc.S
# glapi
glapi.c
glthread.c

View File

@ -36,6 +36,7 @@ All rights reserved.
#define __FUNCTION_OBJECT__
#include <Message.h>
#include <Messenger.h>
#include <MessageFilter.h>
#include <Entry.h>

View File

@ -8,7 +8,6 @@ UsePrivateHeaders tracker ;
AddResources libtracker.so : TrackerIcons.rdef ;
SubDirC++Flags
-fmultiple-symbol-spaces
-D_BUILDING_tracker=1 -DOPEN_TRACKER=1
# -D_INCLUDES_CLASS_DEVICE_MAP=1
-D_SUPPORTS_RESOURCES=1

View File

@ -21,6 +21,8 @@
#include "FuncTranslator.h"
#include <string.h>
namespace BPrivate {

View File

@ -27,6 +27,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
BTranslationUtils::BTranslationUtils()

View File

@ -390,7 +390,7 @@ BTranslatorRoster::Private::AddPath(const char* path, int32* _added)
status_t
BTranslatorRoster::Private::AddTranslator(BTranslator* translator,
image_id image = -1, const entry_ref* ref = NULL, ino_t node = 0)
image_id image, const entry_ref* ref, ino_t node)
{
BAutolock locker(this);

View File

@ -13,6 +13,8 @@
#include <Application.h>
#include <string.h>
static int
compare_items(const void* a, const void* b)

View File

@ -359,7 +359,10 @@ ApplicationTypeWindow::ApplicationTypeWindow(BPoint position, const BEntry& entr
fShortDescriptionControl->SetDivider(labelWidth);
fShortDescriptionControl->GetPreferredSize(&width, &height);
fShortDescriptionControl->ResizeTo(rect.Width(), height);
fShortDescriptionControl->TextView()->SetMaxBytes(sizeof(version_info::short_info));
// TODO: workaround for a GCC 4.1.0 bug? Or is that really what the standard says?
version_info versionInfo;
fShortDescriptionControl->TextView()->SetMaxBytes(sizeof(versionInfo.short_info));
box->AddChild(fShortDescriptionControl);
rect.OffsetBy(0.0f, fShortDescriptionControl->Bounds().Height() + 5.0f);
@ -374,7 +377,7 @@ ApplicationTypeWindow::ApplicationTypeWindow(BPoint position, const BEntry& entr
rect.bottom = rect.top + fShortDescriptionControl->Bounds().Height() * 3.0f - 1.0f;
fLongDescriptionView = new BTextView(rect, "long desc",
rect.OffsetToCopy(B_ORIGIN), B_FOLLOW_ALL, B_WILL_DRAW | B_FRAME_EVENTS);
fLongDescriptionView->SetMaxBytes(sizeof(version_info::long_info));
fLongDescriptionView->SetMaxBytes(sizeof(versionInfo.long_info));
// box->AddChild(fLongDescriptionView);
scrollView = new BScrollView("desc scrollview", fLongDescriptionView,

View File

@ -14,6 +14,8 @@
#include <PopUpMenu.h>
#include <Resources.h>
#include <string.h>
IconView::IconView(BRect rect, const char* name, uint32 resizeMode)
: BView(rect, name, resizeMode, B_WILL_DRAW),

View File

@ -11,6 +11,7 @@
#include "SystemPalette.h"
#include <stdio.h>
#include <stdlib.h>
/*!
@ -457,6 +458,26 @@ RGBColor::operator==(const RGBColor &color) const
}
bool
RGBColor::operator!=(const rgb_color &color) const
{
return fColor32.red != color.red
|| fColor32.green != color.green
|| fColor32.blue != color.blue
|| fColor32.alpha != color.alpha;
}
bool
RGBColor::operator!=(const RGBColor &color) const
{
return fColor32.red != color.fColor32.red
|| fColor32.green != color.fColor32.green
|| fColor32.blue != color.fColor32.blue
|| fColor32.alpha != color.fColor32.alpha;
}
bool
RGBColor::IsTransparentMagic() const
{

View File

@ -34,10 +34,12 @@ class RGBColor {
void SetColor(const rgb_color &color);
void SetColor(const RGBColor &col);
const RGBColor & operator=(const RGBColor &col);
const RGBColor & operator=(const rgb_color &col);
bool operator==(const rgb_color &col) const;
bool operator==(const RGBColor &col) const;
const RGBColor & operator=(const RGBColor &color);
const RGBColor & operator=(const rgb_color &color);
bool operator==(const rgb_color &color) const;
bool operator==(const RGBColor &color) const;
bool operator!=(const rgb_color &color) const;
bool operator!=(const RGBColor &color) const;
bool IsTransparentMagic() const;

View File

@ -31,6 +31,7 @@
#include <dirent.h>
#include <new>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/ioctl.h>

View File

@ -7,8 +7,7 @@
*/
#include <stdio.h>
#include <string.h>
#include "HWInterface.h"
#include "drawing_support.h"
@ -17,7 +16,9 @@
#include "SystemPalette.h"
#include "UpdateQueue.h"
#include "HWInterface.h"
#include <stdio.h>
#include <string.h>
// constructor
HWInterface::HWInterface(bool doubleBuffered)

View File

@ -26,7 +26,6 @@ class ServerBitmap;
class ServerCursor;
class UpdateQueue;
class BString;
struct overlay_buffer;
enum {
HW_ACC_COPY_REGION = 0x00000001,