Changeset e99e43f for examples/ArrayN.c
- Timestamp:
- Jan 10, 2019, 3:50:34 PM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
- Children:
- d97c3a4
- Parents:
- aeb8f70 (diff), 08222c7 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - git-author:
- Aaron Moss <a3moss@…> (01/10/19 14:46:09)
- git-committer:
- Aaron Moss <a3moss@…> (01/10/19 15:50:34)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
examples/ArrayN.c
raeb8f70 re99e43f 7 7 8 8 forall(otype index_t) 9 index_t offset_to_index(unsigned offset, index_t size) 10 { 9 index_t offset_to_index(unsigned offset, index_t size) { 11 10 return [offset / size.0, offset % size.1]; 12 11 } 13 12 14 int main(int argc, char* argv[]) 15 { 13 int main(int argc, char* argv[]) { 16 14 unsigned x = 0, y = 0, i = 0; 17 15 unsigned sx = 4, sy = 4; … … 20 18 [x, y] = offset_to_index(6, [sx, sy]); 21 19 22 sout | x | ' ' | y | endl;20 sout | x | ' ' | y; 23 21 24 22 return 0;
Note:
See TracChangeset
for help on using the changeset viewer.