mirror of https://github.com/KLayout/klayout.git
Wider data types for Windows (long is 32 bit) and for CBLOCK byte counts in OASIS reader
This commit is contained in:
parent
5731c36a35
commit
de784de7ea
|
|
@ -559,41 +559,42 @@ OASISReader::mark_start_table ()
|
||||||
void
|
void
|
||||||
OASISReader::read_offset_table ()
|
OASISReader::read_offset_table ()
|
||||||
{
|
{
|
||||||
unsigned long of = 0;
|
unsigned int of = 0;
|
||||||
|
|
||||||
of = get_uint ();
|
of = get_uint ();
|
||||||
m_table_cellname = get_ulong ();
|
get (m_table_cellname);
|
||||||
if (m_table_cellname != 0 && m_expect_strict_mode >= 0 && ((of == 0) != (m_expect_strict_mode == 0))) {
|
if (m_table_cellname != 0 && m_expect_strict_mode >= 0 && ((of == 0) != (m_expect_strict_mode == 0))) {
|
||||||
warn (tl::to_string (tr ("CELLNAME offset table has unexpected strict mode")));
|
warn (tl::to_string (tr ("CELLNAME offset table has unexpected strict mode")));
|
||||||
}
|
}
|
||||||
|
|
||||||
of = get_uint ();
|
of = get_uint ();
|
||||||
m_table_textstring = get_ulong ();
|
get (m_table_textstring);
|
||||||
if (m_table_textstring != 0 && m_expect_strict_mode >= 0 && ((of == 0) != (m_expect_strict_mode == 0))) {
|
if (m_table_textstring != 0 && m_expect_strict_mode >= 0 && ((of == 0) != (m_expect_strict_mode == 0))) {
|
||||||
warn (tl::to_string (tr ("TEXTSTRING offset table has unexpected strict mode")));
|
warn (tl::to_string (tr ("TEXTSTRING offset table has unexpected strict mode")));
|
||||||
}
|
}
|
||||||
|
|
||||||
of = get_uint ();
|
of = get_uint ();
|
||||||
m_table_propname = get_ulong ();
|
get (m_table_propname);
|
||||||
if (m_table_propname != 0 && m_expect_strict_mode >= 0 && ((of == 0) != (m_expect_strict_mode == 0))) {
|
if (m_table_propname != 0 && m_expect_strict_mode >= 0 && ((of == 0) != (m_expect_strict_mode == 0))) {
|
||||||
warn (tl::to_string (tr ("PROPNAME offset table has unexpected strict mode")));
|
warn (tl::to_string (tr ("PROPNAME offset table has unexpected strict mode")));
|
||||||
}
|
}
|
||||||
|
|
||||||
of = get_uint ();
|
of = get_uint ();
|
||||||
m_table_propstring = get_ulong ();
|
get (m_table_propstring);
|
||||||
if (m_table_propstring != 0 && m_expect_strict_mode >= 0 && ((of == 0) != (m_expect_strict_mode == 0))) {
|
if (m_table_propstring != 0 && m_expect_strict_mode >= 0 && ((of == 0) != (m_expect_strict_mode == 0))) {
|
||||||
warn (tl::to_string (tr ("PROPSTRING offset table has unexpected strict mode")));
|
warn (tl::to_string (tr ("PROPSTRING offset table has unexpected strict mode")));
|
||||||
}
|
}
|
||||||
|
|
||||||
of = get_uint ();
|
of = get_uint ();
|
||||||
m_table_layername = get_ulong ();
|
get (m_table_layername);
|
||||||
if (m_table_layername != 0 && m_expect_strict_mode >= 0 && ((of == 0) != (m_expect_strict_mode == 0))) {
|
if (m_table_layername != 0 && m_expect_strict_mode >= 0 && ((of == 0) != (m_expect_strict_mode == 0))) {
|
||||||
warn (tl::to_string (tr ("LAYERNAME offset table has unexpected strict mode")));
|
warn (tl::to_string (tr ("LAYERNAME offset table has unexpected strict mode")));
|
||||||
}
|
}
|
||||||
|
|
||||||
// XNAME table ignored currently
|
// XNAME table ignored currently
|
||||||
get_uint ();
|
get_uint ();
|
||||||
get_ulong ();
|
size_t dummy = 0;
|
||||||
|
get (dummy);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char magic_bytes[] = { "%SEMI-OASIS\015\012" };
|
static const char magic_bytes[] = { "%SEMI-OASIS\015\012" };
|
||||||
|
|
@ -1084,8 +1085,9 @@ OASISReader::do_read (db::Layout &layout)
|
||||||
error (tl::sprintf (tl::to_string (tr ("Invalid CBLOCK compression type %d")), type));
|
error (tl::sprintf (tl::to_string (tr ("Invalid CBLOCK compression type %d")), type));
|
||||||
}
|
}
|
||||||
|
|
||||||
get_uint (); // uncomp-byte-count - not needed
|
size_t dummy = 0;
|
||||||
get_uint (); // comp-byte-count - not needed
|
get (dummy); // uncomp-byte-count - not needed
|
||||||
|
get (dummy); // comp-byte-count - not needed
|
||||||
|
|
||||||
// put the stream into deflating mode
|
// put the stream into deflating mode
|
||||||
m_stream.inflate ();
|
m_stream.inflate ();
|
||||||
|
|
@ -1282,8 +1284,9 @@ OASISReader::read_element_properties (db::PropertiesRepository &rep, bool ignore
|
||||||
error (tl::sprintf (tl::to_string (tr ("Invalid CBLOCK compression type %d")), type));
|
error (tl::sprintf (tl::to_string (tr ("Invalid CBLOCK compression type %d")), type));
|
||||||
}
|
}
|
||||||
|
|
||||||
get_uint (); // uncomp-byte-count - not needed
|
size_t dummy = 0;
|
||||||
get_uint (); // comp-byte-count - not needed
|
get (dummy); // uncomp-byte-count - not needed
|
||||||
|
get (dummy); // comp-byte-count - not needed
|
||||||
|
|
||||||
// put the stream into deflating mode
|
// put the stream into deflating mode
|
||||||
m_stream.inflate ();
|
m_stream.inflate ();
|
||||||
|
|
@ -1520,7 +1523,7 @@ OASISReader::read_pointlist (modal_variable <std::vector <db::Point> > &pointlis
|
||||||
bool
|
bool
|
||||||
OASISReader::read_repetition ()
|
OASISReader::read_repetition ()
|
||||||
{
|
{
|
||||||
unsigned char type = get_uint ();
|
unsigned int type = get_uint ();
|
||||||
if (type == 0) {
|
if (type == 0) {
|
||||||
|
|
||||||
// reuse modal variable
|
// reuse modal variable
|
||||||
|
|
@ -3308,8 +3311,9 @@ OASISReader::do_read_cell (db::cell_index_type cell_index, db::Layout &layout)
|
||||||
error (tl::sprintf (tl::to_string (tr ("Invalid CBLOCK compression type %d")), type));
|
error (tl::sprintf (tl::to_string (tr ("Invalid CBLOCK compression type %d")), type));
|
||||||
}
|
}
|
||||||
|
|
||||||
get_uint (); // uncomp-byte-count - not needed
|
size_t dummy = 0;
|
||||||
get_uint (); // comp-byte-count - not needed
|
get (dummy); // uncomp-byte-count - not needed
|
||||||
|
get (dummy); // comp-byte-count - not needed
|
||||||
|
|
||||||
// put the stream into deflating mode
|
// put the stream into deflating mode
|
||||||
m_stream.inflate ();
|
m_stream.inflate ();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue