Commit 6aae7c62 authored by Lev Walkin's avatar Lev Walkin

make J2735 compile again

parent 24bf3f6a
......@@ -128,7 +128,7 @@ set +x
echo ' done; done; fi'
echo
echo "maybe-wip-pause:"
echo " @[ -f WIP ] && cat WIP && sleep 2"
echo " @if [ -f WIP ]; then cat WIP; sleep 2; fi"
echo
echo "distclean: clean"
echo ' rm -f $(ASN_MODULE_SOURCES)'
......
......@@ -997,6 +997,7 @@ ASN_MODULE_SOURCES+=constr_SEQUENCE_OF.c
ASN_MODULE_HEADERS+=constr_SET_OF.h
ASN_MODULE_SOURCES+=constr_SET_OF.c
ASN_MODULE_HEADERS+=asn_application.h
ASN_MODULE_HEADERS+=asn_ioc.h
ASN_MODULE_HEADERS+=asn_system.h
ASN_MODULE_HEADERS+=asn_codecs.h
ASN_MODULE_HEADERS+=asn_internal.h
......@@ -1050,7 +1051,7 @@ TARGET = j2735-dump
CPPFLAGS += -DASN_CONVERTER_TITLE="J2735 DSRC decoder" -DHAVE_CONFIG_H -DJUNKTEST -D_DEFAULT_SOURCE -DASN_DISABLE_OER_SUPPORT -DPDU=MessageFrame -I.
OBJS=${ASN_MODULE_SOURCES:.c=.o} ${ASN_CONVERTER_SOURCES:.c=.o}
all: MessageFrame.c $(TARGET)
all: maybe-wip-pause MessageFrame.c $(TARGET)
$(TARGET): ${OBJS}
$(CC) $(CFLAGS) $(CPPFLAGS) -o $(TARGET) ${OBJS} $(LDFLAGS) $(LIBS)
......@@ -1147,6 +1148,9 @@ check-per:
./${TARGET} -J0.001 -n 1000 -b $$b -iper -onull $$f || exit 8; \
done; done; fi
maybe-wip-pause:
@if [ -f WIP ]; then cat WIP; sleep 2; fi
distclean: clean
rm -f $(ASN_MODULE_SOURCES)
rm -f $(ASN_MODULE_HEADERS)
......
......@@ -2732,7 +2732,7 @@ emit_member_type_selector(arg_t *arg, asn1p_expr_t *expr, asn1c_ioc_table_and_ob
OUT("select_%s_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {\n", MKID_safe(expr));
INDENT(+1);
OUT("asn_ioc_set_t *itable = asn_IOS_%s_%d;\n", MKID(opt_ioc->objset),
OUT("const asn_ioc_set_t *itable = asn_IOS_%s_%d;\n", MKID(opt_ioc->objset),
opt_ioc->objset->_type_unique_index);
OUT("size_t constraining_column = %zu; /* %s */\n", constraining_column, cfield);
OUT("size_t for_column = %zu; /* %s */\n", for_column, for_field);
......@@ -2740,7 +2740,7 @@ emit_member_type_selector(arg_t *arg, asn1p_expr_t *expr, asn1c_ioc_table_and_ob
const char *tname = asn1c_type_name(arg, constraining_memb, TNF_SAFE);
if(constraining_memb->marker.flags & EM_INDIRECT) {
OUT("void *memb_ptr = *(const void **)");
OUT("const void *memb_ptr = *(const void **)");
OUT("((const char *)parent_sptr + offsetof(struct ");
out_name_chain(arg, ONC_avoid_keywords);
OUT(", %s));", MKID_safe(constraining_memb));
......@@ -2770,9 +2770,10 @@ emit_member_type_selector(arg_t *arg, asn1p_expr_t *expr, asn1c_ioc_table_and_ob
OUT("\n");
OUT("for(row=0; row < itable->rows_count; row++) {\n");
OUT(" asn_ioc_cell_s *constraining_cell = itable->rows[row * itable->columns_count + constraining_column];\n");
OUT(" asn_ioc_cell_s *type_cell = itable->rows[row * itable->columns_count + for_column];\n");
OUT(" if(constraining_cell->type_descriptor->struct_compare(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {\n");
OUT(" const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];\n");
OUT(" const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];\n");
OUT("\n");
OUT(" if(constraining_cell->type_descriptor->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {\n");
OUT(" return type_cell->type_descriptor;\n");
OUT(" }\n");
OUT("}\n");
......
......@@ -258,8 +258,8 @@ emit_ioc_table(arg_t *arg, asn1p_expr_t *context, asn1c_ioc_table_and_objset_t i
INDENT(-1);
OUT("};\n");
OUT("static asn_ioc_set_t asn_IOS_%s_%d[] = {\n", MKID(ioc_tao.objset),
ioc_tao.objset->_type_unique_index);
OUT("static const asn_ioc_set_t asn_IOS_%s_%d[] = {\n",
MKID(ioc_tao.objset), ioc_tao.objset->_type_unique_index);
INDENT(+1);
OUT("%zu, %zu, asn_IOS_%s_%d_rows\n", ioc_tao.ioct->rows, columns,
MKID(ioc_tao.objset), ioc_tao.objset->_type_unique_index);
......
......@@ -18,10 +18,10 @@ struct asn_ioc_cell_s;
/*
* X.681, #13
*/
struct asn_ioc_set_s {
typedef struct asn_ioc_set_s {
size_t rows_count;
size_t columns_count;
struct asn_ioc_set_cell_s *rows;
const struct asn_ioc_cell_s *rows;
} asn_ioc_set_t;
......@@ -40,7 +40,7 @@ typedef struct asn_ioc_cell_s {
unsigned choice_position;
} *types;
} open_type;
} asn_ioc_cell_s;
} asn_ioc_cell_t;
#ifdef __cplusplus
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment