Skip to content

Commit

Permalink
remove trailing spaces from java sources
Browse files Browse the repository at this point in the history
  • Loading branch information
gaborbata committed Feb 7, 2024
1 parent d5fab40 commit 3de7817
Show file tree
Hide file tree
Showing 444 changed files with 40,644 additions and 40,647 deletions.
30 changes: 15 additions & 15 deletions DMUtils/src/CmdLib.java
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public static FileInputStream SafeOpenRead (String filename)
} catch (Exception e){
Error ("Error opening %s: %s",filename,e.getCause().getMessage());
}

return handle;
}

Expand All @@ -138,9 +138,9 @@ public static void SafeRead (InputStream handle, byte[] buffer) throws IOExcepti
int iocount;
int read=0;
int count=buffer.length;

BufferedInputStream bis=new BufferedInputStream(handle,0x8000);

while (count!=0)
{
iocount=bis.read(buffer,read,count-read);
Expand All @@ -158,7 +158,7 @@ public static void SafeWrite (OutputStream handle, byte[] buffer, int count) thr
public static void SafeWrite (OutputStream handle, short[] buffer) throws IOException
{
DataOutputStream dos=new DataOutputStream(handle);

for (int i=0;i<buffer.length;i++){
dos.writeShort(LittleShort(buffer[i]));
System.out.printf("%x %x\n",buffer[i],LittleShort(buffer[i]));
Expand Down Expand Up @@ -206,7 +206,7 @@ public static void SaveFile (String filename, byte[] buffer) throws IOExcepti
SafeWrite (handle, buffer, buffer.length);
handle.close();
}

public static void SaveFile (String filename, byte[][] buffer) throws IOException
{
OutputStream handle;
Expand Down Expand Up @@ -239,7 +239,7 @@ public static String DefaultExtension (String path, String extension)
src=path.length() - 1;

char PATHSEPERATOR=System.getProperty("path.separator").charAt(0);

while (path.charAt(src)!= PATHSEPERATOR && src>=0)
{
if (path.charAt(src) == '.')
Expand All @@ -259,11 +259,11 @@ public static String StripFilename (String path)

/** Return the filename without extension, and stripped
* of the path.
*
*
* @param s
* @return
*/

public static final String StripExtension(String s) {

String separator = System.getProperty("file.separator");
Expand Down Expand Up @@ -292,17 +292,17 @@ public static final String StripExtension(String s) {
* indicators. There's normally no need to enforce this behavior, as there's
* nothing preventing the engine from INTERNALLY using lump names with >8
* chars. However, just to be sure...
*
*
* @param path
* @param limit Set to any value >0 to enforce a length limit
* @param whole keep extension if set to true
* @return
*/

public static final String ExtractFileBase(String path, int limit, boolean whole) {

if (path==null) return path;

int src = path.length() - 1;

String separator = System.getProperty("file.separator");
Expand All @@ -313,11 +313,11 @@ public static final String ExtractFileBase(String path, int limit, boolean whole

int len = path.lastIndexOf('.');
if (whole || len<0 ) len=path.length()-src; // No extension.
else len-= src;
else len-= src;

// copy UP to the specific number of characters, or all
// copy UP to the specific number of characters, or all
if (limit > 0) len = Math.min(limit, len);

return path.substring(src, src + len);
}

Expand Down Expand Up @@ -419,4 +419,4 @@ public static long LittleLong (long l)
} */


}
}
26 changes: 13 additions & 13 deletions DMUtils/src/dcolors.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

public class dcolors {
public static final String VERSION= "1.1";

public final static int playpal[] = {
0x00,0x00,0x00,0x1F,0x17,0x0B,0x17,0x0F,0x07,0x4B,0x4B,0x4B,0xFF,0xFF,0xFF,0x1B,
0x1B,0x1B,0x13,0x13,0x13,0x0B,0x0B,0x0B,0x07,0x07,0x07,0x2F,0x37,0x1F,0x23,0x2B,
Expand Down Expand Up @@ -194,7 +194,7 @@ static private void RF_BuildLights ()
color15 = getRGB555(red,green,blue);

System.out.printf("Color15 for %2x %2x %2x: %4x %4x\n",red,green,blue,color12,color15);

lightpalette[l][c] = BestColor(red,green,blue,palette,0,255);

color12s[l][c] = color12;
Expand All @@ -213,7 +213,7 @@ static private void RF_BuildLights ()

public static final short getRGB555(int red,int green,int blue){
int ri,gi,bi;

ri = (((red+4)>255?255:red+4))>>3;
ri = ri > 31 ? 31 : ri;
gi = (((green+4)>255?255:green+4))>>3;
Expand All @@ -224,10 +224,10 @@ public static final short getRGB555(int red,int green,int blue){
// RGB555 for HiColor
return (short) ((ri<<10) + (gi<<5) + bi);
}

public static final short getRGBA4444(int red,int green,int blue){
int ri,gi,bi;

ri = (((red+8)>255?255:red+8))>>4;
ri = ri > 15 ? 15 : ri;
gi = (((green+8)>255?255:green+8))>>4;
Expand All @@ -236,7 +236,7 @@ public static final short getRGBA4444(int red,int green,int blue){
bi = bi > 15 ? 15 : bi;

// RGBA 4-4-4-4 packed for NeXT

return (short) ((ri<<12)+ (gi<<8) +(bi<<4)+15);
//return (short)(0xDEAD);
}
Expand Down Expand Up @@ -264,12 +264,12 @@ static private void BuildSpecials ()
green = (float) ((0xFF&palette[palsrc++]) / 256.0);
blue = (float) ((0xFF&palette[palsrc++]) / 256.0);

gray = (int) (255*(1.0-(red*0.299 + green*0.587 + blue*0.144)));
gray = (int) (255*(1.0-(red*0.299 + green*0.587 + blue*0.144)));

color12s[GRAYCOLORMAP][c] = getRGBA4444(gray,gray,gray);
System.out.printf("%4x for %x\n",color12s[GRAYCOLORMAP][c],gray);
color15s[GRAYCOLORMAP][c] = getRGB555(gray,gray,gray);

lightpalette[GRAYCOLORMAP][c] = BestColor(gray,gray,gray,palette,0,255);
}

Expand Down Expand Up @@ -301,7 +301,7 @@ public static void main (String[] argv) throws IOException

System.out.printf ("\nDCOLORS %s by John Carmack, copyright (c) 1992 Id Software\n",VERSION);
/*
if (argv.length != 2) {
if (argv.length != 2) {
CmdLib.Error("dcolors picture.lbm");
} */
Expand All @@ -320,14 +320,14 @@ public static void main (String[] argv) throws IOException
palhandle=CmdLib.SafeOpenRead("PLAYPAL.lmp");
CmdLib.SafeRead(palhandle,palette);
palhandle.close();

for (i=0;i<palette.length;i+=3){
palette[i]=(byte) (0xFF&(playpal[i]));
palette[i+1]=(byte) (0xFF&(playpal[i+1]));
palette[i+2]=(byte) (0xFF&(playpal[i+2]));
System.out.printf("Palette %d: %x %x %x\n",(i/3),palette[i],palette[i+1],palette[i+2]);
}

handle = CmdLib.SafeOpenWrite ("playpal1.lmp");

// Standard palette.
Expand Down Expand Up @@ -390,4 +390,4 @@ public static void main (String[] argv) throws IOException
}


}
}
2 changes: 1 addition & 1 deletion src/automap/IAutoMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ public interface IAutoMap<T, V> {
public void Stop();

public void Start();
}
}
12 changes: 6 additions & 6 deletions src/automap/Map.java
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ public class Map<T, V> implements IAutoMap<T, V> {
/**
* Configurable colors - now an enum
* - Good Sign 2017/04/05
*
*
* Use colormap-specific colors to support extended modes.
* Moved hardcoding in here. Potentially configurable.
*/
Expand Down Expand Up @@ -611,7 +611,7 @@ protected void initVectorGraphics() {
* Calculates the slope and slope according to the x-axis of a line segment
* in map coordinates (with the upright y-axis n' all) so that it can be
* used with the brain-dead drawing stuff.
*
*
* @param ml
* @param is
*/
Expand Down Expand Up @@ -1000,7 +1000,7 @@ public final boolean Responder(event_t ev) {
cheating = (cheating + 1) % 3;
}

/**
/**
* MAES: brought back strobe effect
* Good Sign: setting can be saved/loaded from config
*/
Expand Down Expand Up @@ -1250,7 +1250,7 @@ private boolean clipMline(mline_t ml, fline_t fl) {
/**
* MAES: the result was supposed to be passed in an "oc" parameter by
* reference. Not convenient, so I made some changes...
*
*
* @param mx
* @param my
*/
Expand Down Expand Up @@ -1405,7 +1405,7 @@ else if (plr.powers[pw_allmap] != 0) {

/**
* Rotation in 2D. Used to rotate player arrow line character.
*
*
* @param x
* fixed_t
* @param y
Expand Down Expand Up @@ -1587,4 +1587,4 @@ public final void Drawer() {

//DOOM.videoRenderer.MarkRect(f_x, f_y, f_w, f_h);
}
}
}
6 changes: 3 additions & 3 deletions src/automap/fline_t.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class fline_t {
a=new fpoint_t();
b=new fpoint_t();
}
public fline_t(fpoint_t a, fpoint_t b){
this.a=a;
this.b=b;
Expand All @@ -33,6 +33,6 @@ public void reset() {
this.a.y=0;
this.b.x=0;
this.b.y=0;
}*/
}
}
2 changes: 1 addition & 1 deletion src/automap/fpoint_t.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ public fpoint_t(int x, int y) {
this.y = y;
}

}
}
2 changes: 1 addition & 1 deletion src/automap/islope_t.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ public class islope_t {

/** fixed_t */
int slp, islp;
}
}
8 changes: 4 additions & 4 deletions src/automap/mline_t.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@ public mline_t(int ax,int ay,int bx,int by) {
this.a = new mpoint_t(ax,ay);
this.b = new mpoint_t(bx,by);
}
public mline_t(double ax,double ay,double bx,double by) {
this.a = new mpoint_t(ax,ay);
this.b = new mpoint_t(bx,by);
}
public mpoint_t a, b;
public int ax;
public String toString(){
return a.toString()+" - "+ b.toString();
}
*/
}
}
2 changes: 1 addition & 1 deletion src/automap/mpoint_t.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ public mpoint_t() {
public String toString() {
return (Integer.toHexString(x) + " , " + Integer.toHexString(y));
}
};
};
8 changes: 4 additions & 4 deletions src/awt/DisplayModePicker.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ public DisplayMode pickClosest(int width, int height) {
return picks.get(0);
}

/**
* Return offsets to center rasters too oddly shaped to fit entirely into
/**
* Return offsets to center rasters too oddly shaped to fit entirely into
* a standard display mode (unfortunately, this means most stuff > 640 x 400),
* with doom's standard 8:5 ratio.
*
*
* @param width
* @param height
* @param dm
Expand Down Expand Up @@ -87,4 +87,4 @@ public int compare(DisplayMode arg0, DisplayMode arg1) {
}
}

}
}
6 changes: 3 additions & 3 deletions src/awt/DoomFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public void turnOn() {
/**
* Set it to be later then setResizable to avoid extra space on right and bottom
* - Good Sign 2017/04/09
*
*
* JFrame's size is auto-set here.
*/
pack();
Expand All @@ -98,7 +98,7 @@ public void turnOn() {

setVisible(true);

// Gently tell the eventhandler to wake up and set itself.
// Gently tell the eventhandler to wake up and set itself.
requestFocus();
content.requestFocusInWindow();
}
Expand Down Expand Up @@ -180,4 +180,4 @@ private Graphics2D getGraphics2D() {
private final boolean showFPS = Engine.getCVM().bool(CommandVariable.SHOWFPS);
private long lastTime = System.currentTimeMillis();
private int frames = 0;
}
}
Loading

0 comments on commit 3de7817

Please sign in to comment.