nasa / osal

The Core Flight System (cFS) Operating System Abstraction Layer (OSAL)
Apache License 2.0
556 stars 217 forks source link

JSC: use fixed width types #139

Closed skliper closed 5 years ago

skliper commented 5 years ago

Originally part of trac #45 and isolated for CCB review purposes.

Replace use of native int with fixed-width int32 typedef.

skliper commented 5 years ago

Imported from trac issue 116. Created by jphickey on 2015-11-06T17:17:15, last modified: 2015-12-09T11:13:56

skliper commented 5 years ago

Trac comment by jphickey on 2015-11-09 11:56:47:

Commit [changeset:db75439] is available for CCB review, branch trac-116-jsc-fixed-width-types

skliper commented 5 years ago

Trac comment by jphickey on 2015-11-09 12:01:38:

I have reviewed this and a few issues should be corrected before this is accepted.

skliper commented 5 years ago

Trac comment by jphickey on 2015-11-09 12:03:41:

Another note - the free field should probably be osalbool rather than int32 as well, since that is how it is actually used, being directly compared to the macros/constants TRUE and FALSE.

skliper commented 5 years ago

Trac comment by sstrege on 2015-11-18 15:23:22:

11/17/15 CCB:

skliper commented 5 years ago

Trac comment by sduran on 2015-11-23 18:39:38:

reference commit [changeset:039441c]

skliper commented 5 years ago

Trac comment by jphickey on 2015-11-23 23:47:56:

The changeset looks good and I have merged it to "ic-ccb-review" ....

HOWEVER -- please check your editor settings, as there were a lot of whitespace changes, which create merge conflicts. Commit [changeset:039441c] seems to have "cleaned" a lot of spurious whitespace in addition to the changes listed.

I fully agree on the OStask_id field of the tasks properties structure. This is defined by the OSAL API and it makes two major assumptions that the a) OS-issued task identifiers are integers in nature and b) they are 32 bits or less. These assumptions are false on at least one platform I am aware of - cygwin - where the pthread_t type is actually a structure and it is larger than 32 bits.

But we cannot/should not change the type of the API structure at this time. This sounds like another place to create a new ticket about this and encourage people NOT to use the OStask_id field for anything.

skliper commented 5 years ago

Trac comment by jphickey on 2015-11-24 22:51:15:

Pushed commit [changeset:4d6f76a] which contains the remainder of fixed-width type changes originally in #137 (since it looks like we may not be merging that one).

NOTE: This also contains 3 cases of unused variable removal. That bit probably technically belongs in #141, but that may create extra merge conflicts if it were actually put there, so I left them in here.

skliper commented 5 years ago

Trac comment by sstrege on 2015-11-30 18:39:24:

Recommend the for loop "i" variables be uint32 vs. int32. These will never be negative. Same with the "NumChars" variable defined in osfilesys.c, line 992

osfileapi.c, line 727 - "status" needs to be commented with rational for using non-fixed width type.

Recommend/accept the 3 cases of unused variable removal.

skliper commented 5 years ago

Trac comment by sstrege on 2015-12-07 18:02:22:

Pushed commit f2a8cd5 which changes the looping "i" variables and "NumChars" variable from int32 to uint32. Also added a comment explaining rational for keeping "status" and int.

skliper commented 5 years ago

Trac comment by sstrege on 2015-12-07 22:04:45:

Adding link to pushed commit [changeset:f2a8cd5]

skliper commented 5 years ago

Trac comment by glimes on 2015-12-09 11:08:55:

Commits [changeset:4d6f76a] and [changeset:f2a8cd5] included via merge [changeset:d0a3d1e] into merge [changeset:961b061] which is now the development branch.

skliper commented 5 years ago

Trac comment by glimes on 2015-12-09 11:13:56:

Merge of #136 #138 #139 #141 and #142 (2015-12-01) is now development.