~ubuntu-branches/ubuntu/trusty/xserver-xorg-video-sis/trusty

« back to all changes in this revision

Viewing changes to src/sis_utility.c

  • Committer: Package Import Robot
  • Author(s): Cyril Brulebois
  • Date: 2012-05-01 19:17:28 UTC
  • mfrom: (4.1.7 sid)
  • Revision ID: package-import@ubuntu.com-20120501191728-lin26r5cjg0kfo1k
Tags: 1:0.10.4-1
* New upstream release:
  - Fix FTBFS with X server 1.12.

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
#endif
35
35
 
36
36
#include "sis.h"
37
 
#define NEED_REPLIES
38
 
#define NEED_EVENTS
39
37
#include <X11/X.h>
40
38
#include "dixstruct.h"
41
39
 
1882
1880
    rep.majorVersion = SISCTRL_MAJOR_VERSION;
1883
1881
    rep.minorVersion = SISCTRL_MINOR_VERSION;
1884
1882
    if(client->swapped) {
1885
 
        swaps(&rep.sequenceNumber, n);
1886
 
        swapl(&rep.length, n);
1887
 
        swaps(&rep.majorVersion, n);
1888
 
        swaps(&rep.minorVersion, n);
 
1883
        _swaps(&rep.sequenceNumber, n);
 
1884
        _swapl(&rep.length, n);
 
1885
        _swaps(&rep.majorVersion, n);
 
1886
        _swaps(&rep.minorVersion, n);
1889
1887
    }
1890
1888
    WriteToClient(client, sizeof(xSiSCtrlQueryVersionReply), (char *)&rep);
1891
1889
    return (client->noClientException);
1926
1924
    rep.sequenceNumber = client->sequence;
1927
1925
 
1928
1926
    if(client->swapped) {
1929
 
       swaps(&rep.sequenceNumber, n);
1930
 
       swapl(&rep.length, n);
1931
 
       swapl(&rep.screen, n);
1932
 
       swapl(&rep.sdc_id, n);
1933
 
       swapl(&rep.sdc_command, n);
1934
 
       swapl(&rep.sdc_result_header, n);
 
1927
       _swaps(&rep.sequenceNumber, n);
 
1928
       _swapl(&rep.length, n);
 
1929
       _swapl(&rep.screen, n);
 
1930
       _swapl(&rep.sdc_id, n);
 
1931
       _swapl(&rep.sdc_command, n);
 
1932
       _swapl(&rep.sdc_result_header, n);
1935
1933
       for(i = 0; i < SDC_NUM_PARM_RESULT; i++) {
1936
 
          swapl(&rep.sdc_parm[i], n);
1937
 
          swapl(&rep.sdc_result[i], n);
 
1934
          _swapl(&rep.sdc_parm[i], n);
 
1935
          _swapl(&rep.sdc_result[i], n);
1938
1936
       }
1939
1937
    }
1940
1938
    WriteToClient(client, sizeof(xSiSCtrlCommandReply), (char *)&rep);
1961
1959
{
1962
1960
    REQUEST(xSiSCtrlQueryVersionReq);
1963
1961
    register int n;
1964
 
    swaps(&stuff->length, n);
 
1962
    _swaps(&stuff->length, n);
1965
1963
    REQUEST_SIZE_MATCH(xSiSCtrlQueryVersionReq);
1966
1964
    return SiSProcSiSCtrlQueryVersion(client);
1967
1965
}
1972
1970
    REQUEST(xSiSCtrlCommandReq);
1973
1971
    register int n;
1974
1972
    int i;
1975
 
    swaps(&stuff->length, n);
1976
 
    swapl(&stuff->screen, n);
1977
 
    swapl(&stuff->sdc_id, n);
1978
 
    swapl(&stuff->sdc_command, n);
1979
 
    swapl(&stuff->sdc_result_header, n);
 
1973
    _swaps(&stuff->length, n);
 
1974
    _swapl(&stuff->screen, n);
 
1975
    _swapl(&stuff->sdc_id, n);
 
1976
    _swapl(&stuff->sdc_command, n);
 
1977
    _swapl(&stuff->sdc_result_header, n);
1980
1978
    for(i = 0; i < SDC_NUM_PARM_RESULT; i++) {
1981
 
       swapl(&stuff->sdc_parm[i], n);
1982
 
       swapl(&stuff->sdc_result[i], n);
 
1979
       _swapl(&stuff->sdc_parm[i], n);
 
1980
       _swapl(&stuff->sdc_result[i], n);
1983
1981
    }
1984
1982
    REQUEST_SIZE_MATCH(xSiSCtrlCommandReq);
1985
1983
    return SiSProcSiSCtrlCommand(client);
2007
2005
     * in SiSCtrlExtUnregister())
2008
2006
     */
2009
2007
    if(extEntry->extPrivate) {
2010
 
       xfree(extEntry->extPrivate);
 
2008
       free(extEntry->extPrivate);
2011
2009
       extEntry->extPrivate = NULL;
2012
2010
    }
2013
2011
}
2028
2026
 
2029
2027
   if(!(myext = CheckExtension(SISCTRL_PROTOCOL_NAME))) {
2030
2028
 
2031
 
      if(!(myctrl = xcalloc(sizeof(xSiSCtrlScreenTable), 1)))
 
2029
      if(!(myctrl = calloc(sizeof(xSiSCtrlScreenTable), 1)))
2032
2030
         return;
2033
2031
 
2034
2032
      if(!(myext = AddExtension(SISCTRL_PROTOCOL_NAME, 0, 0,
2038
2036
                                StandardMinorOpcode))) {
2039
2037
         xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
2040
2038
                        "Failed to add SISCTRL extension\n");
2041
 
         xfree(myctrl);
 
2039
         free(myctrl);
2042
2040
         return;
2043
2041
      }
2044
2042