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 678703
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T01:10:44+00:00 2026-05-14T01:10:44+00:00

I am new to shifting bits, but I am trying to debug the following

  • 0

I am new to shifting bits, but I am trying to debug the following snippet:

if (!(strcmp(arr[i].GetValType(), "f64")))
 {
        dem_content_buff[BytFldPos] = tmp_data;
     dem_content_buff[BytFldPos + 1] =  tmp_data >> 8;
     dem_content_buff[BytFldPos + 2] = tmp_data >> 16;
     dem_content_buff[BytFldPos + 3] = tmp_data >> 24;
     dem_content_buff[BytFldPos + 4] = tmp_data >> 32;
     dem_content_buff[BytFldPos + 5] = tmp_data >> 40;
     dem_content_buff[BytFldPos + 6] = tmp_data >> 48;
     dem_content_buff[BytFldPos + 7] = tmp_data >> 56;
        }    

I am getting a warning saying the lines with “32” to “56” have a shift count that is too large. The “f64” in the predicate just means that the data should be 64bit data.

How should this be done?

edit:

I should have put more of the code in.

tmp_data = simulated_data[index_data];

if (!(strcmp(dems[i].GetValType(), "s32")))

{
dem_content_buff[BytFldPos] = tmp_data;
dem_content_buff[BytFldPos + 1] = tmp_data >> 8;
dem_content_buff[BytFldPos + 2] = tmp_data >> 16;
dem_content_buff[BytFldPos + 3] = tmp_data >> 24;
}

if (!(strcmp(dems[i].GetValType(), “f64”)))
{
dem_content_buff[BytFldPos] = tmp_data;
dem_content_buff[BytFldPos + 1] = tmp_data >> 8;
dem_content_buff[BytFldPos + 2] = tmp_data >> 16;
dem_content_buff[BytFldPos + 3] = tmp_data >> 24;
dem_content_buff[BytFldPos + 4] = tmp_data >> 32;
dem_content_buff[BytFldPos + 5] = tmp_data >> 40;
dem_content_buff[BytFldPos + 6] = tmp_data >> 48;
dem_content_buff[BytFldPos + 7] = tmp_data >> 56;
}

So, dem_content_buff right now only holds ints. Can I not use this array for the 64 bit data either?

  • 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-05-14T01:10:44+00:00Added an answer on May 14, 2026 at 1:10 am

    Make sure to use 64bit long type for the tmp_data as was suggested before the unsinged long long should work, but check your compiler and architecture documentation.

    The code should look like this. Also, make sure that your demp_content_buff is declared as unsigned char * or unsigned char [].

    Then change your code to:

    if (!(strcmp(arr[i].GetValType(), "f64")))
        {
            dem_content_buff[BytFldPos] =  ( tmp_data & 0xff );
            dem_content_buff[BytFldPos + 1] =  (tmp_data >> 8 ) & 0xff ;
            dem_content_buff[BytFldPos + 2] =  (tmp_data >> 16) & 0xff ;
            dem_content_buff[BytFldPos + 3] =  (tmp_data >> 24) & 0xff;
            dem_content_buff[BytFldPos + 4] =  (tmp_data >> 32) & 0xff;
            dem_content_buff[BytFldPos + 5] =  (tmp_data >> 40) & 0xff;
            dem_content_buff[BytFldPos + 6] =  (tmp_data >> 48) & 0xff;
            dem_content_buff[BytFldPos + 7] =  (tmp_data >> 56) & 0xff;
            }   
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

New to javascript, but I'm sure this is easy. Unfortunately, most of the google
New to all this so forgive my ignorance. I am trying to figure out
New to LINQ.. I am curious as to the syntax to do the following
I'm very new to SIMD/SSE and I'm trying to do some simple image filtering
I am new to Assembly, but not new to programming and how it works
I'm new in Android development. I'm looking for any method that applies pitch shifting
I am trying to make a breadth-first search to solve a square-shifting puzzle (the
I will be shifting my code base to the new 2.0 framework and just
New Question I am looking for a way in Javascript to get the parent
new_story GET /story/new(.:format) {:action=>new, :controller=>stories} edit_story GET /story/edit(.:format) {:action=>edit, :controller=>stories} story GET /story(.:format) {:action=>show,

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.