Search:

Type: Posts; User: adetheheat

Search: Search took 0.01 seconds.

  1. Replies
    5
    Views
    5,134

    great that worked ! many thanks

    great that worked ! many thanks
  2. Replies
    5
    Views
    5,134

    Thanks for your help: #define PACK_ON(n)...

    Thanks for your help:


    #define PACK_ON(n) _Pragma("pack(" #n ")")
    gave error: _Pragma takes a parenthesized string literal

    and


    #define PACK_ON(n) _Pragma("pack(" ## #n ## ")")
  3. Replies
    5
    Views
    5,134

    pragma pack in a preprocessing directive

    I want to put #pragma pack(n) as a preprocessor define.
    eg


    #define PACK_ON(n) _Pragma("pack(n)")
    PACK_ON(2)

    I get the compile warning:

    warning: unknown action 'n' for...
  4. Replies
    2
    Views
    1,781

    bracket in the wrong place. many thanks

    bracket in the wrong place.
    many thanks
  5. Replies
    2
    Views
    1,781

    preprocessor size calc and error check

    I have the following #defines
    Code:


    #define BLDR_FRAME_SIZE (((4u + (PR_BOOTLOADER_NUM_TRANSACTIONS_PER_FRAME * 3u * 6u) + \
    ...
  6. Turns out I needed the following around my extern...

    Turns out I needed the following around my extern "C":

    #ifdef __cplusplus
    extern "C" void call_GatewayList_Send(struct lgw_pkt_rx_s pkt_data);
    #endif

    then define the function in the cpp file...
  7. Thanks for that, what you have said is pretty...

    Thanks for that, what you have said is pretty much what I have done now. Worth pointing out I'm building in the Eclipse IDE environment with a Cygwin compiler. The code is pretty much 50% C and 50%...
  8. yes the prototype is definitely in the C file as...

    yes the prototype is definitely in the C file as I said above, but in any case here is the direct cut from the file:


    void call_GatewayList_Send(struct lgw_pkt_rx_s pkt_data);
    void...
  9. Calling C++ function from C (yes I realise this has been done to death !)

    I have my GatewayLT.hpp list class:


    class GatewayList
    {
    private:
    typedef std::list<Gateway*> GatewayStoreType;
    GatewayStoreType store;

    public:
  10. ok using gdb for debugging it gets stuck on...

    ok using gdb for debugging it gets stuck on pthread_mutex_lock. After some playing about I discovered there is only 1 thread that has tried to lock it and that is the main calling thread. So I'm...
  11. They were the first things I tried. i did a grep...

    They were the first things I tried. i did a grep for 'main' and there is only one and that is in MainNS.cpp as expected. Also there are no macros doing anything with 'main'.
  12. linux makefile - c++ builds ok but won't run. However build using g++ then it works

    My project builds and runs on windows. Using makefile on linux then it builds but when I run it nothing at all comes out. The project has about 30 files in it. So I cut down the main function in file...
  13. this doesn't work: int main(int argc,...

    this doesn't work:



    int main(int argc, char* argv[])
    {
    int n;
    string stringvalues;
    //int val[6];
    unsigned char val[6];
  14. this worked but i wanted hexvalue to be unsigned...

    this worked but i wanted hexvalue to be unsigned char, this didn't work - none of the values written to it were correct
  15. So I'd do something like: istringstream...

    So I'd do something like:




    istringstream iss (mystring,istringstream::in);

    int hexval[6];
    int temp;
  16. using istringstream class to parse a string to get hex numbers

    Suppose I have a string with hex numbers in it like this "1a:2b:3c:4d:5e:6f"
    How do I use istringstream to parse it to get each of 1a, 2b, 3d, 4d, 5e, 6f hex numbers ?


    cheers
Results 1 to 16 of 16