Skip to content

Unable to convert Fixnum to long long (mapnik::value_integer) #56

@gravitystorm

Description

@gravitystorm

When running the tests we receive the error:

  1) Error:
test_should_add_a_geometry(TestMapnikFeature):
ArgumentError: Unable to convert Fixnum to long long

The test is straighforward:

assert feature = Mapnik::Feature.new(Mapnik::Context.new, 1)

There are four identical failing tests, unsurprisingly! The constructor takes a value_integer type:

rb_cfeature.define_constructor(Rice::Constructor< mapnik::Feature,mapnik::context_ptr,value_integer >());

... and value_integer is defined based on the mapnik_version:

#if MAPNIK_VERSION >= 200200
       typedef mapnik::value_integer value_integer;
#else
       typedef int value_integer;
#endif

... and of course, mapnik::value_integer is defined in mapnik as a long long (2.2.0, 2.3.x)

I've found some advice from rice mailing list posts and docs that suggest we need to explicitly convert the fixnum into a long long, but I don't know actually how to do that i.e. what code to put where. Within _mapnik_colour.cpp there is an example of using NUM2INT, which might provide a clue, but I don't know where to go from here.

Suggestions welcome!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions