Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Marek Ratajczak's 64-bit patch #1218

Open
wants to merge 1 commit into
base: 4.4
Choose a base branch
from

Conversation

EdgarReynaldo
Copy link
Contributor

No description provided.

@SiegeLord
Copy link
Member

I wouldn't even begin to know how to compile A4 on windows, could someone try this?

@@ -737,7 +737,7 @@ int uoffset(AL_CONST char *s, int index)
}
}

return (long)s - (long)orig;
return (long long)s - (long long)orig;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cast is pointless to begin with, just change it to: "return s - orig;" instead

@@ -2065,7 +2065,7 @@ PACKFILE *pack_fopen_chunk(PACKFILE *f, int pack)
return NULL;
}
_al_sane_strncpy(chunk->normal.passdata, f->normal.passdata, strlen(f->normal.passdata)+1);
chunk->normal.passpos = chunk->normal.passdata + (long)f->normal.passpos - (long)f->normal.passdata;
chunk->normal.passpos = chunk->normal.passdata + (ULONG_PTR)f->normal.passpos - (ULONG_PTR)f->normal.passdata; //64bit long
Copy link
Contributor

@allefant allefant Jan 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ULONG_PTR will not exist in most compilers, did you mean intptr_t?

@pedro-w
Copy link
Contributor

pedro-w commented Jan 14, 2021

This may be a bit late but I wish we could use the stdint.h support and say int64_t, int32_t etc instead of relying on long long or long or whatever.

@EdgarReynaldo
Copy link
Contributor Author

I will try to build in next day or so - @pedro-w why can't we use stdint.h? don't we use it else where?

@pedro-w
Copy link
Contributor

pedro-w commented Jan 24, 2021

@EdgarReynaldo I didn't mean we can't, just that we haven't in this patch. It is used quite extensively in the rest of the code. I think it would be better but it's not my place to insist on anything and I don't have the time to propose the changes myself.

@ericoporto
Copy link

@EdgarReynaldo did you ever figure this out? I am trying to figure out why the "normal" packfile lseek returns a gigantic number in 64-bit systems, breaking the normal refill buffer and the normal get.

@EdgarReynaldo
Copy link
Contributor Author

@ericoporto I forgot all about this. I think it would be best to take Pedro's advice and use stdint.h types instead of long modifiers, which vary per platform. If it can be adjusted, I think it would apply cleanly, as it already does. If you do it I will test building it for you, but I don't really have the understanding to modify it with confidence.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants