[QUESTION] warning : cast from pointer to integer of different size #400

Closed
opened 2026-01-29 16:43:02 +00:00 by claunia · 2 comments
Owner

Originally created by @krushanbauva on GitHub (Mar 4, 2018).

Please prefix your issue with one of the following: [BUG], [PROPOSAL], [QUESTION].

CCExtractor version (using the --version parameter preferably) : X.X

In raising this issue, I confirm the following (please check boxes, eg [X] - and delete unchecked ones):

  • [x ] I have read and understood the contributors guide.
  • [x ] I have checked that the bug-fix I am reporting can be replicated, or that the feature I am suggesting isn't already present.
  • [x ] I have checked that the issue I'm posting isn't already reported.
  • [x ] I have checked that the issue I'm porting isn't already solved and no duplicates exist in closed issues and in opened issues
  • [x ] I have checked the pull requests tab for existing solutions/implementations to my issue/suggestion.
  • [x ] I have used the latest available version of CCExtractor to verify this issue exists.

My familiarity with the project is as follows (check one, eg [X] - and delete unchecked ones):

  • I have never used CCExtractor.
  • I have used CCExtractor just a couple of times.
  • I absolutely love CCExtractor, but have not contributed previously.
  • [x ] I am an active contributor to CCExtractor.

Necessary information

  • Is this a regression (did it work before)? [x ] NO | [ ] YES - please specify the last known working version
  • What platform did you use? [ ] Windows - [x ] Linux - [ ] Mac
  • What were the used arguments? -autoprogram

**Video links (replace text below with your links) **

Please make the affected input file available for us (no screenshots, those don't help!). Public links to Dropbox, Google Drive, etc, are all fine. If it is not possible to make it available publicly, send us a private invitation (both Dropbox and Google Drive allow that). In this case we will download the file and upload it to the private developer repository.

Do not upload your file to any location that will require us to sign up or endure a wait list, slow downloads, etc. If your upload expires make sure you keep it active somehow (replace links if needed). Keep in mind that while we go over all tickets some may take a few days, and it's important we have the file available when we actually need it.

Additional information

While I was working to resolve the warning generated during the build process, I needed some clarity on what this part of code in function gf_color_write_yv12_10_to_yuv inside src/gpacmp4/color.c does

#ifdef GPAC_HAS_SSE2

#ifdef GPAC_64_BITS
#define GFINTCAST  (u64)
#else
#define GFINTCAST  (u32)
#endif

	if ( (w%32 == 0)
	        && (GFINTCAST (vs_dst->video_buffer + vs_dst->pitch_y)%8 == 0)
	        && (GFINTCAST (vs_dst->video_buffer + vs_dst->pitch_y * vs_dst->height + vs_dst->pitch_y/2)%8 == 0)
	        && (GFINTCAST (pU + src_stride/2)%8 == 0)
	        && (GFINTCAST (pV + src_stride/2)%8 == 0)
	   ) {
		return gf_color_write_yv12_10_to_yuv_intrin(vs_dst, pY, pU, pV, src_stride, src_width, src_height, _src_wnd, swap_uv);
	}
#endif

Since GPAC_HAS_SSE2 is defined this way in the same file and there are no other references of GPAC_HAS_SSE2 in the entire codebase and also the code to be executed if GPAC_HAS_SSE2 is defined is present directly below this piece of code.

#if defined(WIN32) && !defined(__GNUC__)
# include <intrin.h>
# define GPAC_HAS_SSE2
#else
# ifdef __SSE2__
#  include <emmintrin.h>
#  define GPAC_HAS_SSE2
# endif
#endif

I'm not able to figure out the need of #ifdef GPAC_HAS_SSE2 piece of code inside the function gf_color_write_yv12_10_to_yuv

PS: Make sure you set an alert in GitHub so you get notifications about your ticket. We may need to ask questions and we do everything inside GitHub's system.

Originally created by @krushanbauva on GitHub (Mar 4, 2018). Please prefix your issue with one of the following: [BUG], [PROPOSAL], [QUESTION]. CCExtractor version (using the --version parameter preferably) : **X.X** **In raising this issue, I confirm the following (please check boxes, eg [X] - and delete unchecked ones):** - [x ] I have read and understood the [contributors guide](https://github.com/CCExtractor/ccextractor/blob/master/.github/CONTRIBUTING.md). - [x ] I have checked that the bug-fix I am reporting can be replicated, or that the feature I am suggesting isn't already present. - [x ] I have checked that the issue I'm posting isn't already reported. - [x ] I have checked that the issue I'm porting isn't already solved and no duplicates exist in [closed issues](https://github.com/CCExtractor/ccextractor/issues?q=is%3Aissue+is%3Aclosed) and in [opened issues](https://github.com/CCExtractor/ccextractor/issues) - [x ] I have checked the pull requests tab for existing solutions/implementations to my issue/suggestion. - [x ] I have used the latest available version of CCExtractor to verify this issue exists. **My familiarity with the project is as follows (check one, eg [X] - and delete unchecked ones):** - [ ] I have never used CCExtractor. - [ ] I have used CCExtractor just a couple of times. - [ ] I absolutely love CCExtractor, but have not contributed previously. - [x ] I am an active contributor to CCExtractor. **Necessary information** - Is this a regression (did it work before)? [x ] NO | [ ] YES - *please specify the last known working version* - What platform did you use? [ ] Windows - [x ] Linux - [ ] Mac - What were the used arguments? `-autoprogram` **Video links (replace text below with your links) ** Please make the affected input file available for us (no screenshots, those don't help!). Public links to Dropbox, Google Drive, etc, are all fine. If it is not possible to make it available publicly, send us a private invitation (both Dropbox and Google Drive allow that). In this case we will download the file and upload it to the private developer repository. Do *not* upload your file to any location that will require us to sign up or endure a wait list, slow downloads, etc. If your upload expires make sure you keep it active somehow (replace links if needed). Keep in mind that while we go over all tickets some may take a few days, and it's important we have the file available when we actually need it. **Additional information** While I was working to resolve the warning generated during the build process, I needed some clarity on what this part of code in function `gf_color_write_yv12_10_to_yuv` inside `src/gpacmp4/color.c` does ```c #ifdef GPAC_HAS_SSE2 #ifdef GPAC_64_BITS #define GFINTCAST (u64) #else #define GFINTCAST (u32) #endif if ( (w%32 == 0) && (GFINTCAST (vs_dst->video_buffer + vs_dst->pitch_y)%8 == 0) && (GFINTCAST (vs_dst->video_buffer + vs_dst->pitch_y * vs_dst->height + vs_dst->pitch_y/2)%8 == 0) && (GFINTCAST (pU + src_stride/2)%8 == 0) && (GFINTCAST (pV + src_stride/2)%8 == 0) ) { return gf_color_write_yv12_10_to_yuv_intrin(vs_dst, pY, pU, pV, src_stride, src_width, src_height, _src_wnd, swap_uv); } #endif ``` Since `GPAC_HAS_SSE2` is defined this way in the same file and there are no other references of `GPAC_HAS_SSE2` in the entire codebase and also the code to be executed if `GPAC_HAS_SSE2` is defined is present directly below this piece of code. ```c #if defined(WIN32) && !defined(__GNUC__) # include <intrin.h> # define GPAC_HAS_SSE2 #else # ifdef __SSE2__ # include <emmintrin.h> # define GPAC_HAS_SSE2 # endif #endif ``` I'm not able to figure out the need of `#ifdef GPAC_HAS_SSE2` piece of code inside the function `gf_color_write_yv12_10_to_yuv` PS: Make sure you set an alert in GitHub so you get notifications about your ticket. We may need to ask questions and we do everything inside GitHub's system.
Author
Owner

@cfsmp3 commented on GitHub (Mar 6, 2018):

Well, GPAC_HAS_SSE2 seems to be defined

  1. For Windows if the compiler is not GNU
  2. Otherwise if _SSE2 is defined.

_SSE2 is defined by the compiler automatically:
https://stackoverflow.com/questions/28939652/how-to-detect-sse-avx-avx2-avx-512-availability-at-compile-time

So that's where the condition is - compilation options.

(Markup is messing my comment because of the underscores but should be readable)

@cfsmp3 commented on GitHub (Mar 6, 2018): Well, GPAC_HAS_SSE2 seems to be defined 1) For Windows if the compiler is not GNU 2) Otherwise if __SSE2_ is defined. __SSE2_ is defined by the compiler automatically: https://stackoverflow.com/questions/28939652/how-to-detect-sse-avx-avx2-avx-512-availability-at-compile-time So that's where the condition is - compilation options. (Markup is messing my comment because of the underscores but should be readable)
Author
Owner

@cfsmp3 commented on GitHub (Dec 23, 2018):

Closing, not an issue and it's answered.

@cfsmp3 commented on GitHub (Dec 23, 2018): Closing, not an issue and it's answered.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ccextractor#400