Is the old code making any assumptions about the size of an int when
doing the bit shifting?
On 10/15/07, Hudson, Loren (GE Infra, Aviation, Non-GE, US)
<loren.hudson@xxxxxx> wrote:
>
>
> All,
>
> I'm currently working on porting some C code over to Java. The code opens a
> binary file, extracts the relevant data, and spits out a .csv file. I'm
> getting some issues with the totals being off.
>
> The code was originally written by an engineer, not a programmer. This is
> the fourth such program I've ported, and haven't had any real issues. For
> the most part, I just wrap the already-written C code with some Java data
> structures, change the file i/o to use Java commands, and I'm done. The
> program uses bit masking, bit shifting, and a whole host of global
> variables.
>
> My question is this: Are there any pitfalls that you know of that I could
> be falling into with the C code that compiles as Java code? I've never used
> C before, so this program is really the extent to which I know C.
>
> Thanks,
> Mike Hudson
> MDW - Military Data Warehouse
> Java Developer/Solution Architect
> Sogeti Consultant
> loren.hudson@xxxxxx
>
|