Fixed some compiler warnings (mostly virtual functions w/ non-virtual destructors).

This commit is contained in:
zuperdee%penguinpowered.com 1999-06-30 22:36:04 +00:00
Родитель e9ff7b62e7
Коммит 6472891394
7 изменённых файлов: 30 добавлений и 37 удалений

Просмотреть файл

@ -207,15 +207,13 @@ uint8 nsDeviceContextMotif :: AllocColor(uint8 aRed, uint8 aGreen, uint8 aBlue,
return(color.pixel);
}
// No more colors left, now must look for closest match.
// No color found so look for the closest match
uint8 closest = 0;
uint8 r, g, b;
unsigned long distance = ~0;
unsigned long d;
int dr, dg, db;
// No color found so look for the closest match
for (int colorindex = 0; colorindex < 256; colorindex++) {
r = mDeviceColors[colorindex].red >> 8;
g = mDeviceColors[colorindex].green >> 8;
@ -448,7 +446,7 @@ NS_IMETHODIMP nsDeviceContextMotif :: CheckFontExistence(const nsString& aFontNa
void nsDeviceContextMotif::AllocColors()
{
uint8* index = new uint8[256];
uint8* inx = new uint8[256];
if (PR_TRUE == mColorsAllocated)
return;
@ -471,7 +469,7 @@ void nsDeviceContextMotif::AllocColors()
reserved[i].red = sReservedColors[i].red;
reserved[i].green = sReservedColors[i].green;
reserved[i].blue = sReservedColors[i].blue;
index[i] = i;
inx[i] = i;
}
#else
IL_RGB reserved[1]; //XXX REMOVE THIS here and below
@ -483,15 +481,14 @@ void nsDeviceContextMotif::AllocColors()
IL_ColorSpace* colorSpace = IL_CreatePseudoColorSpace(colorMap, 8, 8);
// Create a logical palette
XColor xcolor;
NI_RGB* map = colorSpace->cmap.map;
for (PRInt32 colorindex = RESERVED_SIZE; colorindex < (COLOR_CUBE_SIZE + RESERVED_SIZE); colorindex++) {
index[colorindex] = AllocColor(map->red, map->green, map->blue, PR_TRUE);
inx[colorindex] = AllocColor(map->red, map->green, map->blue, PR_TRUE);
map++;
}
mIndex = index;
mIndex = inx;
if (mColorSpace)
mColorSpace->cmap.index = mIndex;

Просмотреть файл

@ -32,7 +32,7 @@ class nsFontMetricsMotif : public nsIFontMetrics
{
public:
nsFontMetricsMotif();
~nsFontMetricsMotif();
virtual ~nsFontMetricsMotif();
NS_DECL_AND_IMPL_ZEROING_OPERATOR_NEW
@ -77,8 +77,4 @@ protected:
nscoord mMaxAdvance;
};
#endif
#endif // nsFontMetricsMotif_h__

Просмотреть файл

@ -53,7 +53,7 @@ class nsGfxFactoryMotif : public nsIFactory
NS_IMETHOD LockFactory(PRBool aLock);
nsGfxFactoryMotif(const nsCID &aClass);
~nsGfxFactoryMotif();
virtual ~nsGfxFactoryMotif();
private:
nsrefcnt mRefCnt;

Просмотреть файл

@ -186,7 +186,7 @@ void nsImageMotif :: ImageUpdated(nsIDeviceContext *aContext, PRUint8 aFlags, ns
NS_IMETHODIMP nsImageMotif :: Draw(nsIRenderingContext &aContext, nsDrawingSurface aSurface, PRInt32 aSX, PRInt32 aSY, PRInt32 aSWidth, PRInt32 aSHeight,
PRInt32 aDX, PRInt32 aDY, PRInt32 aDWidth, PRInt32 aDHeight)
{
nsDrawingSurfaceMotif *unixdrawing =(nsDrawingSurfaceMotif*) aSurface;
nsDrawingSurfaceMotif *motifdrawing =(nsDrawingSurfaceMotif*) aSurface;
if ((PR_FALSE==mStaticImage) || (nsnull == mImage)) {
BuildImage(aSurface);
@ -195,7 +195,7 @@ NS_IMETHODIMP nsImageMotif :: Draw(nsIRenderingContext &aContext, nsDrawingSurfa
if (nsnull == mImage)
return NS_ERROR_FAILURE;
XPutImage(unixdrawing->display,unixdrawing->drawable,unixdrawing->gc,mImage,
XPutImage(motifdrawing->display,motifdrawing->drawable,motifdrawing->gc,mImage,
aSX,aSY,aDX,aDY,aDWidth,aDHeight);
return NS_OK;
@ -209,7 +209,7 @@ NS_IMETHODIMP nsImageMotif :: Draw(nsIRenderingContext &aContext,
PRInt32 aX, PRInt32 aY,
PRInt32 aWidth, PRInt32 aHeight)
{
nsDrawingSurfaceMotif *unixdrawing =(nsDrawingSurfaceMotif*) aSurface;
nsDrawingSurfaceMotif *motifdrawing =(nsDrawingSurfaceMotif*) aSurface;
BuildImage(aSurface);
@ -221,7 +221,7 @@ NS_IMETHODIMP nsImageMotif :: Draw(nsIRenderingContext &aContext,
if (nsnull == mImage)
return NS_ERROR_FAILURE;
XPutImage(unixdrawing->display,unixdrawing->drawable,unixdrawing->gc,mImage,
XPutImage(motifdrawing->display,motifdrawing->drawable,motifdrawing->gc,mImage,
0,0,aX,aY,aWidth,aHeight);
return NS_OK;
}
@ -242,7 +242,7 @@ void nsImageMotif::AllocConvertedBits(PRUint32 aSize)
void nsImageMotif::ConvertImage(nsDrawingSurface aDrawingSurface)
{
nsDrawingSurfaceMotif *unixdrawing =(nsDrawingSurfaceMotif*) aDrawingSurface;
nsDrawingSurfaceMotif *motifdrawing =(nsDrawingSurfaceMotif*) aDrawingSurface;
PRUint8 *tempbuffer,*cursrc,*curdest;
PRInt32 x,y;
PRUint16 red,green,blue,*cur16;
@ -250,7 +250,7 @@ PRUint16 red,green,blue,*cur16;
mBitsForCreate = mImageBits;
#if 0
if((unixdrawing->depth==24) && (mOriginalDepth==8))
if((motifdrawing->depth==24) && (mOriginalDepth==8))
{
// convert this nsImage to a 24 bit image
mDepth = 24;
@ -293,7 +293,7 @@ PRUint16 red,green,blue,*cur16;
}
// convert the 8 bit image to 16 bit
if((unixdrawing->depth==16) && (mOriginalDepth==8))
if((motifdrawing->depth==16) && (mOriginalDepth==8))
{
mDepth = 16;
ComputePaletteSize(mDepth);
@ -361,15 +361,15 @@ void nsImageMotif::CreateImage(nsDrawingSurface aSurface)
PRUint32 wdepth;
Visual * visual ;
PRUint32 format ;
nsDrawingSurfaceMotif *unixdrawing =(nsDrawingSurfaceMotif*) aSurface;
nsDrawingSurfaceMotif *motifdrawing =(nsDrawingSurfaceMotif*) aSurface;
if(mImageBits) {
format = ZPixmap;
#if 0
/* Need to support monochrome too */
if (unixdrawing->visual->c_class == TrueColor ||
unixdrawing->visual->c_class == DirectColor) {
if (motifdrawing->visual->c_class == TrueColor ||
motifdrawing->visual->c_class == DirectColor) {
format = ZPixmap;
}
else {
@ -380,11 +380,11 @@ printf("Format XYPixmap\n");
/* printf("Width %d Height %d Visual Depth %d Image Depth %d\n",
mWidth, mHeight,
unixdrawing->depth, mDepth); */
motifdrawing->depth, mDepth); */
mImage = ::XCreateImage(unixdrawing->display,
unixdrawing->visual,
unixdrawing->depth,
mImage = ::XCreateImage(motifdrawing->display,
motifdrawing->visual,
motifdrawing->depth,
format,
0,
(char *)mBitsForCreate,
@ -392,9 +392,9 @@ printf("Format XYPixmap\n");
(unsigned int)mHeight,
32,mRowBytes);
mImage->byte_order = ImageByteOrder(unixdrawing->display);
mImage->bits_per_pixel = unixdrawing->depth;
mImage->bitmap_bit_order = BitmapBitOrder(unixdrawing->display);
mImage->byte_order = ImageByteOrder(motifdrawing->display);
mImage->bits_per_pixel = motifdrawing->depth;
mImage->bitmap_bit_order = BitmapBitOrder(motifdrawing->display);
mImage->bitmap_unit = 32;
}
return ;

Просмотреть файл

@ -38,7 +38,7 @@ class nsImageMotif : public nsIImage
{
public:
nsImageMotif();
~nsImageMotif();
virtual ~nsImageMotif();
NS_DECL_ISUPPORTS
@ -137,4 +137,4 @@ private:
};
#endif
#endif // nsImageMotif_h___

Просмотреть файл

@ -29,7 +29,7 @@ class nsRegionMotif : public nsIRegion
{
public:
nsRegionMotif();
~nsRegionMotif();
virtual ~nsRegionMotif();
NS_DECL_ISUPPORTS

Просмотреть файл

@ -51,7 +51,7 @@ class nsRenderingContextMotif : public nsIRenderingContext
{
public:
nsRenderingContextMotif();
~nsRenderingContextMotif();
virtual ~nsRenderingContextMotif();
NS_DECL_AND_IMPL_ZEROING_OPERATOR_NEW
@ -188,4 +188,4 @@ private:
};
#endif /* nsRenderingContextMotif_h___ */
#endif // nsRenderingContextMotif_h___