Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
codes
codes
Commits
2b992d55
Commit
2b992d55
authored
Aug 03, 2015
by
Jonathan Jenkins
Browse files
add explicit "uninitialized" map ctx; change default ctx to ptr
parent
2710e1fe
Changes
2
Hide whitespace changes
Inline
Side-by-side
codes/codes-mapping-context.h
View file @
2b992d55
...
...
@@ -18,7 +18,7 @@
/* for convenience - an annotation-ignoring "group_modulo" context,
* matching previous mapping behavior in most interfaces (modelnet and such) */
extern
struct
codes_mctx
const
CODES_MCTX_DEFAULT
;
extern
struct
codes_mctx
const
*
const
CODES_MCTX_DEFAULT
;
/* types of map contexts */
enum
codes_mctx_type
{
...
...
@@ -31,7 +31,9 @@ enum codes_mctx_type {
CODES_MCTX_GROUP_MODULO
,
// instructs those using the context to map into the same group/repetition
// and directly to a callee offset
CODES_MCTX_GROUP_DIRECT
CODES_MCTX_GROUP_DIRECT
,
// unknown/uninitialized context
CODES_MCTX_UNKNOWN
};
/* defines whether to specialize by destination annotation, and if so, which
...
...
@@ -80,7 +82,8 @@ struct codes_mctx codes_mctx_set_group_direct(
bool
ignore_annotations
);
/* helper function to do a codes mapping - this function is subject to change
* based on what types of ctx exist */
* based on what types of ctx exist
* NOTE: in GLOBAL_DIRECT mode, dest_lp_name and sender are ignored */
tw_lpid
codes_mctx_to_lpid
(
struct
codes_mctx
const
*
ctx
,
char
const
*
dest_lp_name
,
...
...
src/util/codes-mapping-context.c
View file @
2b992d55
...
...
@@ -7,7 +7,7 @@
#include <codes/codes-mapping-context.h>
#include <codes/codes_mapping.h>
struct
codes_mctx
const
CODES_MCTX_DEFAULT
=
{
static
struct
codes_mctx
const
CODES_MCTX_DEFAULT
_VAL
=
{
.
type
=
CODES_MCTX_GROUP_MODULO
,
.
u
=
{
.
group_modulo
=
{
...
...
@@ -19,6 +19,8 @@ struct codes_mctx const CODES_MCTX_DEFAULT = {
}
};
struct
codes_mctx
const
*
const
CODES_MCTX_DEFAULT
=
&
CODES_MCTX_DEFAULT_VAL
;
struct
codes_mctx
codes_mctx_set_global_direct
(
tw_lpid
lpid
)
{
struct
codes_mctx
rtn
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment