Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8336333
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T03:57:20+00:00 2026-06-09T03:57:20+00:00

When I compile in and64 platform: I can’t seem to figure it out. Here’s

  • 0

When I compile in and64 platform:
I can’t seem to figure it out. Here’s one of the lines it has trouble with:

static gboolean scan_freq(gpointer data)
{
    static gint start, mom, max;
    gint dir = (gint)(data); /// <- cast to pointer from integer of different size

    if (!max) {
        max = (FREQ_MAX - FREQ_MIN) * STEPS;
    }   

    if (radio_check_station(gtk_adjustment_get_value(adj)/STEPS) || (start > max))  {
        start = mom = 0;
        radio_unmute();
        timeout_id = 0;
        return FALSE;
    }
    if (!mom) {
        mom = gtk_adjustment_get_value(adj);
    }

    if (mom > FREQ_MAX*STEPS) 
        mom = FREQ_MIN*STEPS;
    else if (mom < FREQ_MIN*STEPS)
        mom = FREQ_MAX*STEPS;
    else    
        mom = mom + dir;
    start += 1;
    gtk_adjustment_set_value(adj, mom);

    return TRUE;
}

And:

extern int mom_ps;
void preset_menuitem_activate_cb(GtkMenuItem *menuitem, gpointer user_data)
{
    preset* ps;
    mom_ps = (int)user_data;  /// <- cast to pointer from integer of different size

    g_assert(mom_ps >= 0 && mom_ps < g_list_length(settings.presets));

    ps = (preset*)g_list_nth_data(settings.presets, mom_ps);
    gtk_adjustment_set_value(adj, ps->freq * STEPS);
}

Getting: cast to pointer from integer of different size warning

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T03:57:21+00:00Added an answer on June 9, 2026 at 3:57 am

    It’s actually a confusing error message since you seem to be casting away from a pointer.

    However, the error is basically complaining that the types are not compatible.

    Assuming that you’ve actually passed an integer as a pointer (Gnome specifically forbids trying to store pointers in an integer type), you should probably be using the actual type conversion macros like GPOINTER_TO_INT?

    If instead, that pointer is a pointer to an integer, you should be deferencing it rather than casting it, something like:

    gint dir = *((gint*)data);
    

    The fact that it only happens on AMD64 is because that’s the sort of platform where pointers and integers would be a different size, one 64-bit, the other 32-bit.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm getting a compile errors, that I can't really fix. I need to create
I want to compile my .java's (several) into one .jar that are compatible with
Is there any way I can cross-compile C/C++ code for Windows (XP, Vista, Win7),
I am trying to compile a code that has a malloc function inside the
Here is the situation : Our Dev Team has heterogeneous OS systems, scattered between
I am working on quite a large project that has to compile in Debug
The compile process on my EC2 micro instance is really slow, so I'm gonna
I compile a project and run it on my system, it does perfectly fine.
I compile my file with javac myfile.java But when I run myfile.class file with
I compile my C++ program to LLVM IR using the following command. clang++ -O4

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.