Git Product home page Git Product logo

Comments (3)

yiyuezhuo avatar yiyuezhuo commented on June 25, 2024

Thanks to the issue since I try to use UnityPack and build the module. In my Windows 64 plateform, the (uint32) should cast to (long long) (It's mentioned in same stackoverflow link) to get the build done.

from decrunch.

jleclanche avatar jleclanche commented on June 25, 2024

Is this still an issue in 0.4.0?

from decrunch.

Sembiance avatar Sembiance commented on June 25, 2024

Still happening with the very latest github master version with python 3.6. And yes, changing the casts on line 2347 and 2369 from (uint32) to (long long) fixes it.

sembiance@lostcrag ~/tmp/decrunch $ sudo python setup.py install
running install
running bdist_egg
running egg_info
writing decrunch.egg-info/PKG-INFO
writing dependency_links to decrunch.egg-info/dependency_links.txt
writing top-level names to decrunch.egg-info/top_level.txt
reading manifest template 'MANIFEST.in'
writing manifest file 'decrunch.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_ext
building 'decrunch' extension
x86_64-pc-linux-gnu-g++ -pthread -fPIC -Icrunch -I/usr/include/python3.6m -c decrunch.cpp -o build/temp.linux-x86_64-3.6/decrunch.o -std=c++11
x86_64-pc-linux-gnu-g++ -pthread -fPIC -Icrunch -I/usr/include/python3.6m -c crn_decomp.cpp -o build/temp.linux-x86_64-3.6/crn_decomp.o -std=c++11
In file included from crn_decomp.cpp:18:
crunch/crn_decomp.h: In function ‘void* crnd::crnd_malloc(size_t, size_t*)’:
crunch/crn_decomp.h:2347:23: error: cast from ‘crnd::uint8*’ {aka ‘unsigned char*’} to ‘crnd::uint32’ {aka ‘unsigned int’} loses precision [-fpermissive]
 2347 |  CRND_ASSERT(((uint32)p_new & (CRND_MIN_ALLOC_ALIGNMENT - 1)) == 0);
      |                       ^~~~~
crunch/crn_decomp.h:468:13: note: in definition of macro ‘CRND_ASSERT’
  468 |  (void)((!!(_exp)) || (crnd::crnd_assert(#_exp, __FILE__, __LINE__), 0))
      |             ^~~~
crunch/crn_decomp.h: In function ‘void* crnd::crnd_realloc(void*, size_t, size_t*, bool)’:
crunch/crn_decomp.h:2369:23: error: cast from ‘void*’ to ‘crnd::uint32’ {aka ‘unsigned int’} loses precision [-fpermissive]
 2369 |  CRND_ASSERT(((uint32)p_new & (CRND_MIN_ALLOC_ALIGNMENT - 1)) == 0);
      |                       ^~~~~
crunch/crn_decomp.h:468:13: note: in definition of macro ‘CRND_ASSERT’
  468 |  (void)((!!(_exp)) || (crnd::crnd_assert(#_exp, __FILE__, __LINE__), 0))
      |             ^~~~
error: command 'x86_64-pc-linux-gnu-g++' failed with exit status 1
sembiance@lostcrag ~/tmp/decrunch $ x86_64-pc-linux-gnu-g++ --version
x86_64-pc-linux-gnu-g++ (Gentoo 9.1.0-r1 p1.1) 9.1.0
sembiance@lostcrag ~/tmp/decrunch $ python --version
Python 3.6.8

from decrunch.

Related Issues (14)

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.