GithubHelp home page GithubHelp logo

Comments (6)

bvssvni avatar bvssvni commented on June 25, 2024

@petevine Can you test this? We could try filepathname.as_ptr() as *const _.

from freetype-rs.

MagaTailor avatar MagaTailor commented on June 25, 2024

It does compile - I haven't seen this solution yet (a couple of crates have been fixed so far).
Isn't it too permissive or prone to some new kind of error in the future?

EDIT:
I didn't pay attention to version history - was 0.4.0 new enough? (i.e. using libc 0.2?)

from freetype-rs.

bvssvni avatar bvssvni commented on June 25, 2024

@petevine Did the error happen on the old version of freetype-rs? Is it fixed now?

from freetype-rs.

bvssvni avatar bvssvni commented on June 25, 2024

@petevine Yes, there have been upgrades to libc 0.2 that might change how it worked.

from freetype-rs.

MagaTailor avatar MagaTailor commented on June 25, 2024

The fix allows the current version (0.4.0) to compile.

from freetype-rs.

MagaTailor avatar MagaTailor commented on June 25, 2024

Forgot to try on stable 1.5:

Compiling freetype-rs v0.4.1
/tmp/.cargo-1.5/registry/src/github.com-48ad6e4054423464/freetype-rs-0.4.1/src/face.rs:314:32: 314:43 error: mismatched types:
 expected `*const i8`,
    found `*mut u8`
(expected i8,
    found u8) [E0308]
/tmp/.cargo-1.5/registry/src/github.com-48ad6e4054423464/freetype-rs-0.4.1/src/face.rs:314                 CStr::from_ptr(family_name).to_bytes().to_vec()
                                                                                                                          ^~~~~~~~~~~
/tmp/.cargo-1.5/registry/src/github.com-48ad6e4054423464/freetype-rs-0.4.1/src/face.rs:314:32: 314:43 help: run `rustc --explain E0308` to see a detailed explanation
/tmp/.cargo-1.5/registry/src/github.com-48ad6e4054423464/freetype-rs-0.4.1/src/face.rs:327:32: 327:42 error: mismatched types:
 expected `*const i8`,
    found `*mut u8`
(expected i8,
    found u8) [E0308]
/tmp/.cargo-1.5/registry/src/github.com-48ad6e4054423464/freetype-rs-0.4.1/src/face.rs:327                 CStr::from_ptr(style_name).to_bytes().to_vec()
                                                                                                                          ^~~~~~~~~~
/tmp/.cargo-1.5/registry/src/github.com-48ad6e4054423464/freetype-rs-0.4.1/src/face.rs:327:32: 327:42 help: run `rustc --explain E0308` to see a detailed explanation
/tmp/.cargo-1.5/registry/src/github.com-48ad6e4054423464/freetype-rs-0.4.1/src/face.rs:352:32: 352:41 error: mismatched types:
 expected `*const i8`,
    found `*const u8`
(expected i8,
    found u8) [E0308]
/tmp/.cargo-1.5/registry/src/github.com-48ad6e4054423464/freetype-rs-0.4.1/src/face.rs:352                 CStr::from_ptr(face_name).to_bytes().to_vec()
                                                                                                                          ^~~~~~~~~
/tmp/.cargo-1.5/registry/src/github.com-48ad6e4054423464/freetype-rs-0.4.1/src/face.rs:352:32: 352:41 help: run `rustc --explain E0308` to see a detailed explanation
/tmp/.cargo-1.5/registry/src/github.com-48ad6e4054423464/freetype-rs-0.4.1/src/library.rs:68:40: 68:53 error: mismatched types:
 expected `*const u8`,
    found `*const i8`
(expected u8,
    found i8) [E0308]
/tmp/.cargo-1.5/registry/src/github.com-48ad6e4054423464/freetype-rs-0.4.1/src/library.rs:68             ffi::FT_New_Face(self.raw, path.as_ptr(), face_index as ffi::FT_Long, &mut face)
                                                                                                                                    ^~~~~~~~~~~~~
/tmp/.cargo-1.5/registry/src/github.com-48ad6e4054423464/freetype-rs-0.4.1/src/library.rs:68:40: 68:53 help: run `rustc --explain E0308` to see a detailed explanation
error: aborting due to 4 previous errors

A few casts should fix that as well.

from freetype-rs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.