Skip to content
Browse files

Merge pull request #10 from kntroh/floatInit

A floating point number initialize with 0.
  • Loading branch information...
2 parents b40f032 + 76a31b2 commit bd14b7eac6c55741ea49784d295721bd9ae4fe81 @jacob-carlborg jacob-carlborg committed Aug 6, 2012
View
2 src/org/eclipse/swt/graphics/FontData.d
@@ -68,7 +68,7 @@ public final class FontData {
* platforms and should never be accessed from application code.
* </p>
*/
- public float height;
+ public float height = 0;
/**
* The locales of the font
View
6 src/org/eclipse/swt/graphics/GCData.d
@@ -42,10 +42,10 @@ public final class GCData {
public Pattern foregroundPattern;
public Pattern backgroundPattern;
public int lineStyle = SWT.LINE_SOLID;
- public float lineWidth;
+ public float lineWidth = 0;
public int lineCap = SWT.CAP_FLAT;
public int lineJoin = SWT.JOIN_MITER;
- public float lineDashesOffset;
+ public float lineDashesOffset = 0;
public float[] lineDashes;
public float lineMiterLimit = 10;
public int alpha = 0xFF;
@@ -63,7 +63,7 @@ public final class GCData {
public Gdip.SolidBrush gdipFgBrush;
public Gdip.SolidBrush gdipBgBrush;
public Gdip.Font gdipFont;
- public float gdipXOffset, gdipYOffset;
+ public float gdipXOffset = 0, gdipYOffset = 0;
public int uiState = 0;
public bool focusDrawn;
}
View
6 src/org/eclipse/swt/graphics/LineAttributes.d
@@ -34,7 +34,7 @@ public class LineAttributes {
/**
* The line width.
*/
- public float width;
+ public float width = 0;
/**
* The line style.
@@ -74,12 +74,12 @@ public class LineAttributes {
/**
* The line dash style offset for SWT.LINE_CUSTOM.
*/
- public float dashOffset;
+ public float dashOffset = 0;
/**
* The line miter limit.
*/
- public float miterLimit;
+ public float miterLimit = 0;
/**
* Create a new line attributes with the specified line width.
View
2 src/org/eclipse/swt/graphics/RGB.d
@@ -103,7 +103,7 @@ public this (float hue, float saturation, float brightness) {
brightness < 0 || brightness > 1) {
SWT.error(SWT.ERROR_INVALID_ARGUMENT);
}
- float r, g, b;
+ float r = 0, g = 0, b = 0;
if (saturation is 0) {
r = g = b = brightness;
} else {
View
2 src/org/eclipse/swt/internal/gdip/Gdip.d
@@ -1138,7 +1138,7 @@ public:
static float Font_GetSize( Font font )
{
- float size;
+ float size = 0;
SetStatus( GdipGetFontSize( font, size ) );
return size;
}
View
12 src/org/eclipse/swt/internal/gdip/native.d
@@ -78,10 +78,10 @@ struct GpColorPalette {
}
public struct GpRectF {
- public float X;
- public float Y;
- public float Width;
- public float Height;
+ public float X = 0;
+ public float Y = 0;
+ public float Width = 0;
+ public float Height = 0;
}
public struct GpRect {
@@ -95,8 +95,8 @@ public struct GpPoint {
public int Y;
}
public struct GpPointF {
- public float X;
- public float Y;
+ public float X = 0;
+ public float Y = 0;
}
alias int function(void*) GpDrawImageAbort;
View
2 src/org/eclipse/swt/internal/image/JPEGDecoder.d
@@ -2075,7 +2075,7 @@ public class JPEGDecoder {
int scale_num, scale_denom; /* fraction by which to scale image */
- double output_gamma; /* image gamma wanted in output */
+ double output_gamma = 0; /* image gamma wanted in output */
bool buffered_image; /* true=multiple output passes */
bool raw_data_out; /* true=downsampled data wanted */
View
4 src/org/eclipse/swt/ole/win32/Variant.d
@@ -54,8 +54,8 @@ public final class Variant {
private wchar charData;
private int intData;
private long longData;
- private float floatData;
- private double doubleData;
+ private float floatData = 0;
+ private double doubleData = 0;
private String stringData;
private void* byRefPtr;
private IDispatch dispatchData;

0 comments on commit bd14b7e

Please sign in to comment.
Something went wrong with that request. Please try again.