• entries
24
21
• views
17428

# Obscure, Incomprehensible and just plain Broken

238 views

I was off work this week. Tomorrow could be interesting since I think the code I checked in just before I left might have broken the build. It should only be a small break, but unfortunately build success is a binary state - the build is either broken or it's not. I did email them about it with steps to fix so hopefully it won't have been much of a problem.

I spent my week working on the Jpeg2000 loader again, working through the new source code I talked about last month. Also Christmas shopping, playing DHTML Lemmings and various other random activities, so not actually as much time on the loader as I'd been intending.

The new source code is still pretty awful:
int i,k1,k2,k3,k4,l;           // countersint tmp1,tmp2,tmp3,tmp4;       // temporary storage for sample valuesint mv1,mv2,mv3,mv4;           // max value for each componentint ls1,ls2,ls3,ls4;           // level shift for each componentint fb1,fb2,fb3,fb4;           // fractional bits for each componentint[] data1,data2,data3,data4; // references to data buffersfinal ImageConsumer[] cons;    // image consumers cacheint hints;                     // hints to image consumersint height;                    // image heightint width;                     // image widthint pixbuf[];                  // line buffer for pixel dataDataBlkInt db1,db2,db3,db4;    // data-blocks to request data from srcint tOffx, tOffy;              // Active tile offsetboolean prog;                  // Flag for progressive dataCoord nT = src.getNumTiles(null);// 38 lines which don't modify nT or src// getNumTiles is a non-modifying getternT = src.getNumTiles(null);
Not to mention the seemingly everpresent "what, you mean some people don't use the same size tabs as me" interchange of tabs and spaces for indentation. I really ought to find a beautifier. Still, it's easier to work through that the jasper source. Feels a bit strange to be working with Java again though.

Next weeks installment will either be a day early or won't get written, since I'm away for Christmas as of next Sunday.

?nigma

## 1 Comment

Me think you be quite right: this code is ugly [grin]

## Create an account

Register a new account