# translate-c: Correctly translate enum init values, addressing \#1360 \(\#1377\) · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/b8ce8f219c48ae833199130ce575241f848d690b)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: b8ce8f219c48ae833199130ce575241f848d690b

Requested commit: b8ce8f219c48ae833199130ce575241f848d690b

Commit: b8ce8f219c48ae833199130ce575241f848d690b

Tree: d8e17d413ef63a156daafcc679ba4cd62913469f

Author: Michael Noronha

Committer: Andrew Kelley

## Message

```
translate-c: Correctly translate enum init values, addressing #1360 (#1377)

* translate-c: Correctly translate enum init values

* translate-c: Test enum initialization

* translate-c: Flip to positive using APSInt builtins

* src/translate_c.cpp: correctly bridge llvm::APSInt with Zig BigInt;

ACHTUNG: llvm::APSInt stores an int's sign inside of its getRawData; Internally to Zig we store an integer's sign outside of getRawData! (~aps_int) calls .flip() internally on the raw data to match Zig.

* test/translate_c.zig: enum: add wider range of values (u64) to try;

closes #1360
```

## Parents

- [3ee1b60edf8ee53ac7850aaee13c43f2db3a8661](https://git.cafe/gitcafe/zig/commit/3ee1b60edf8ee53ac7850aaee13c43f2db3a8661?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/b8ce8f219c48ae833199130ce575241f848d690b?format=markdown)
