Skip to content

Conversation

Parashurama
Copy link
Contributor

@Parashurama Parashurama commented May 27, 2017

EDIT: The failing test is caused by differences in type conversion between the different platforms & the VM.
Will go back to this later, once this issue is solved.
EDIT: needs integer cast support in VM (PR #5908 waiting for review)

@Parashurama Parashurama force-pushed the bitops_use_endians branch from b48be21 to 8512599 Compare May 27, 2017 21:26
@ghost
Copy link

ghost commented Jun 5, 2017

I wouldn't mind losing the Int suffix. Also, is it necessary to export the procs for the individual types in addition to:

proc swapEndian*[T:SomeInteger](x: T): T

?

@Parashurama
Copy link
Contributor Author

I think that the Int suffix was to prevent name confusion (no name collision) with
littleEndian/bigEndian enums in system.nim

@data-man
Copy link
Contributor

data-man commented Apr 6, 2018

@Parashurama

Any progress?

@Parashurama
Copy link
Contributor Author

Parashurama commented Apr 15, 2018

issue #7587 as well as any sign extension bug should now be fixed.

@Parashurama Parashurama changed the title add 'swapEndian' intrinsics to bitops & swapEndianInt to endians module . add 'swapEndian' intrinsics to bitops & endians module . Apr 15, 2018
template toUint32[T](x: T): uint32 =
when sizeof(x) == 1: cast[uint8](x).uint32
elif sizeof(x) == 2: cast[uint16](x).uint32
else: cast[uint32](x)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be elif sizeof(x) == 4: cast[uint32](x) else: {.error: "invalid size".} and likewise for the other parts where this pattern is used.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not relevant as of 1.3.5 278b458

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oups, didn't realize PR was closed but not merged

@krux02 krux02 self-assigned this Nov 7, 2018
@krux02
Copy link
Contributor

krux02 commented Feb 17, 2019

@krux02 krux02 closed this Feb 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants