DESCRIPTION

ctf: Move non-aligned reads to a unified method

* Clean up integer reading
* Clean up string reading
* Clean up enumeration reading
* Clean up float reading
* Clean up structure reading

Change-Id: I3627f0c1aaecbaa84d861cba05c0681a7b267388
Signed-off-by: Ivy Mitchell xxx@xxx.xxx


COMMENTS

author: Braxton Mccarthy
date: 2013-11-14 23:55:13.000000000

Uploaded patch set 4.

-------------------------------------
author: Braxton Mccarthy
date: 2013-11-14 23:55:48.000000000

Patch Set 4: Verified+1 Code-Review+1 IP-Clean+1

Looks good, I just added a xxx@xxx.xxx annotation.

-------------------------------------
author: Brenden Conley
date: 2013-11-15 00:23:18.000000000

Patch Set 4:

Build Started https://hudson.eclipse.org/linuxtools/job/linuxtools-gerrit/3943/

-------------------------------------
author: Brenden Conley
date: 2013-11-15 01:04:59.000000000

Patch Set 4: Verified+1

Build Successful 

https://hudson.eclipse.org/linuxtools/job/linuxtools-gerrit/3943/ : SUCCESS

-------------------------------------
author: Jordon Obrien
date: 2013-11-15 03:22:14.000000000

Patch Set 4:

(1 comment)

drive-by.

Line:141, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/event/types/Definition.java -> alignment can be done that way:
int pos = (input.position()  + (align - 1)) % align;

-------------------------------------
author: Jordon Obrien
date: 2013-11-16 02:30:22.000000000

Patch Set 4: Code-Review+1

(1 comment)

I added explanation, and fixed my erroneous example.

Line:141, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/event/types/Definition.java -> Sorry, I wasn't clear. I wrote this comment as a test to try the code review.

int pos = input.position();   // actual position
pos += (align - pos) % align;   // arithmetic in modulo align

In fact,
  ((((x % m) - y) % m)  + z)  % m   ->   x - y + z   (% m)

So, the inner "% align" in your code is useless.

-------------------------------------
author: Braxton Mccarthy
date: 2013-11-17 05:02:02.000000000

Patch Set 4: Code-Review+2

Thanks for the comment Etienne, it's quicker/cleaner indeed. I'll merge this and put your suggestion in separate patch, to keep the refactor and code change separate.

-------------------------------------
author: Braxton Mccarthy
date: 2013-11-17 05:07:29.000000000

Patch Set 4:

(1 comment)

Line:141, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/event/types/Definition.java -> hmm, are you sure about this? I tried it and it skips/fails a bunch of CTF unit tests. Seems it fails to read the CTF magic number.

-------------------------------------
author: Braxton Mccarthy
date: 2013-11-17 05:12:39.000000000

Patch Set 4:

(1 comment)

Line:141, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/event/types/Definition.java -> nevermind, it works with the second example. Pushed it to https://git.eclipse.org/r/#/c/18466/

-------------------------------------
