Our new Indie Games subforum is now open for business in G&T. Go and check it out, you might land a code for a free game. If you're developing an indie game and want to post about it,
follow these directions. If you don't, he'll break your legs! Hahaha! Seriously though.
Our rules have been updated and given
their own forum. Go and look at them! They are nice, and there may be new ones that you didn't know about! Hooray for rules! Hooray for The System! Hooray for Conforming!
Another Job Thread? I could do that at home with MS Word!
Posts
Hey, look. It is just void* because it doesn't know what you WANT.
It wants to make you happy.
It will be anything you want, baby.
Anything.
Programmer jokes all up ins.
Probably not in low level drivers (although you can do it that way), but many modern games are written in C++.
So reinterpret_casts have their uses.
Yeah, big-time games are definitely one of C++'s strongholds, though it seems to be under attack for other native applications.
Just out of curiosity, what is reinterpret_cast legitimately used for?
SE++ Forum Battle Archive | PST = Pacific Standard Time | DRUNKSTUCK: A Homestuck recap
Reinterpreting bit patterns.
Or this is a good example:
http://stackoverflow.com/questions/573294/when-to-use-reinterpret-cast
One case when reinterpret_cast is necessary is when interfacing with opaque data types. This occurs frequently in vendor APIs over which the programmer has no control. Here's a contrived example where a vendor provides an API for storing and retrieving arbitrary global data:
// vendor.hpp
typedef struct _Opaque * VendorGlobalUserData;
void VendorSetUserData( VendorGlobalUserData p );
VendorGlobalUserData VendorGetUserData();
To use this API, the programmer must cast their data to VendorGlobalUserData and back again. static_cast won't work, one must use reinterpret_cast:
// main.cpp
#include "vendor.hpp"
#include <iostream>
using namespace std;
struct MyUserData {
MyUserData() : m( 42 ) {}
int m;
};
int main() {
MyUserData u;
// store global data
VendorGlobalUserData d1;
// d1 = &u; // compile error
// d1 = static_cast< VendorGlobalUserData >( &u ); // compile error
d1 = reinterpret_cast< VendorGlobalUserData >( &u ); // ok
VendorSetUserData( d1 );
// do other stuff...
// retrieve global data
VendorGlobalUserData d2 = VendorGetUserData();
MyUserData * p = 0;
// p = d2; // compile error
// p = static_cast< MyUserData * >( d2 ); // compile error
p = reinterpret_cast< MyUserData * >( d2 ); // ok
if ( p ) { cout << p->m << endl; }
return 0;
}
Below is a contrived implementation of the sample API:
// vendor.cpp
static VendorGlobalUserData g = 0;
void VendorSetUserData( VendorGlobalUserData p ) { g = p; }
VendorGlobalUserData VendorGetUserData() { return g; }
But it does answer the question of why you couldn't just memcpy it.
SE++ Forum Battle Archive | PST = Pacific Standard Time | DRUNKSTUCK: A Homestuck recap
Yeah, my first thought of an answer was "The API is shitty and you can't change it"
I.e. a lot of projects I've worked on. haha
Boss: Hey, have you checked the schedule for the week?
Me: Not yet, but I checked my email 2 hours ago.
Boss: Well what have you been doing?
Me: Watching the Oscars.
Boss: Oh? Do the Oscars put food on the table?
Me: What?
Boss: Exactly.
I FUCKING DESPISE HIM.
What the hell
This is the same boss who talked down to me about reporting a lot of miles for my bi-weekly report. Never mind the fact that he requested I display how many miles I drove for work or the fact that he set the schedule for such days of work.
Nope, totally my fault that I have to drive 82 miles a day for work.
He doesn't tell you the schedule until... the DAY you're supposed to be working? How in the world is that supposed to work
I will typically receive the schedule the very evening before that week of work.
And this is still a loose schedule because he could immediately, and has in the past, thrown work on me. I'll finish up a case and be driving home when I will get this phone call:
Boss: Hello?
Me: Hey.
Boss: Yeah, hey! How was work?
Me: Okay.
Boss: Good, good... So I'm gonna need you to go work with Jonathan right now.
Me: I'm on the freeway, seven exits away from where he lives. I'm basically half-way home now.
Boss: Hmm... Seems like you're gonna have to pull around than aren't you?
Me: What?
Boss: Yep, bye.
This is a man who mocked a coworker after she complained about one of our teenagers threatening to beat her to death with a steel bat in his hand.
This is a man without rules.
It seems like this is something the state agency that is funding you would probably want to know about.
god damned making puns, sneaking that shit in
They are terrible things.
good to hear!
How do you solve the bossy female co-worker problem?
Stale, Nino and I did some serious damage there once.
Go into the downtown area and get mugged/shot/beat up/car jacked/stabbed/sold drugs/peed on
Not necessarily in that order.
Also, go see the USCGC Taney in the Inner Harbor. The last ship floating that fought back during the attack on Pearl Harbor. Also my dad served on the ship during Vietnam.
edit: well not on that ship while literally in Vietnam, but after serving 2 tours he got a better assignment
Edit: Wait, he may have actually been on that ship in Vietnam. I didn't realize that the ship was part of Operation Market Time to stop the smuggling of troops and supplies from north to south. I really should get him to record his service somewhere.
This is what I was thinking. This isn't typical "not good at being a manager" stuff you're describing, it's abuse.
wow. I've worked with some hardcore Type-A workaholics before, but that sets a new high score
you ask "Are we fuckin'?"
and when they respond in the negative, tell them that is the only leverage they would have for telling you what to do.
Twitter Steam Facebook Tumblr Secret Satans
What if the response was "not yet" or "maybe"?
Then you have to go through a decision process of risk vs reward based on type of work, her level of bossy, the rudeness of titties, and how hittable that ass is.
Yeah being a doormat is totally gonna increase your chances of sleeping with them while not ruining your job success at all. Great strategy.
Hence decision tree. For a meh to average looking female co-worker, it's not worth the hassle. For say Kate Upton or Mila Kunis...I'd be at least willing to entertain strategies.
It's not a doormat, it's a battle plan.