Changeset 13946


Ignore:
Timestamp:
05/27/12 21:15:20 (12 years ago)
Author:
tbretz
Message:
Fixed the problem with the anonymous structs in older compilers.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/gui/MainWindow.cc

    r13237 r13946  
    557557{
    558558    static const struct Data { int32_t id; char on; } __attribute__((__packed__)) d = { -1, 1 };
    559     Dim::SendCommand("FTM_CONTROL/ENABLE_FTU", &d, sizeof(d));
     559    Dim::SendCommand("FTM_CONTROL/ENABLE_FTU", &d, sizeof(Data));
    560560}
    561561
     
    563563{
    564564    static const struct Data { int32_t id; char on; } __attribute__((__packed__)) d = { -1, 0 };
    565     Dim::SendCommand("FTM_CONTROL/ENABLE_FTU", &d, sizeof(d));
     565    Dim::SendCommand("FTM_CONTROL/ENABLE_FTU", &d, sizeof(Data));
    566566}
    567567
     
    694694        return;
    695695
    696     const struct { uint16_t ch; float val; } __attribute__((__packed__)) val = {
     696    const struct Data { uint16_t ch; float val; } __attribute__((__packed__)) val = {
    697697        uint16_t(fBiasHvBoard->value()*32+fBiasHvChannel->value()),
    698698        float(fBiasVolt->value())
    699699    };
    700700
    701     Dim::SendCommand("BIAS_CONTROL/SET_CHANNEL_VOLTAGE", val);
     701    Dim::SendCommand("BIAS_CONTROL/SET_CHANNEL_VOLTAGE", &val, sizeof(Data));
    702702}
    703703
     
    733733        return;
    734734
    735     const struct { uint16_t ch; float val; } __attribute__((__packed__)) val = {
     735    const struct Data { uint16_t ch; float val; } __attribute__((__packed__)) val = {
    736736        uint16_t(fBiasHvBoard->value()*32+fBiasHvChannel->value()),
    737737        float(fBiasOffsetVolt->value())
    738738    };
    739739
    740     Dim::SendCommand("BIAS_CONTROL/INCREASE_CHANNEL_VOLTAGE", val);
     740    Dim::SendCommand("BIAS_CONTROL/INCREASE_CHANNEL_VOLTAGE", &val, sizeof(Data));
    741741}
    742742
     
    760760        return;
    761761
    762     const struct { uint16_t ch; float val; } __attribute__((__packed__)) val = {
     762    const struct Data { uint16_t ch; float val; } __attribute__((__packed__)) val = {
    763763        uint16_t(fBiasHvBoard->value()*32+fBiasHvChannel->value()),
    764764        float(fBiasOffsetVolt->value())
    765765    };
    766766
    767     Dim::SendCommand("BIAS_CONTROL/SET_CHANNEL_OFFSET", val);
     767    Dim::SendCommand("BIAS_CONTROL/SET_CHANNEL_OFFSET", &val, sizeof(Data));
    768768}
    769769
Note: See TracChangeset for help on using the changeset viewer.