Changeset 7637


Ignore:
Timestamp:
Jul 3, 2004, 11:05:58 PM (16 years ago)
Author:
ssen
Message:

Eliminate compiler warnings.
1) Use C-style comments, not C++, since we don't require a C99 compiler
2) Mark parameters unused if using gcc
3) Make point casts match function prototype

Location:
trunk/base/src/darwinports1.0
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/src/darwinports1.0/darwinports.h

    r3626 r7637  
    4444int dp_array_get_count(dp_array_t a);
    4545const void* dp_array_get_index(dp_array_t a, int index);
    46 // something for delete
     46/* something for delete */
    4747
    4848dp_session_t dp_session_open();
  • trunk/base/src/darwinports1.0/portconf.c

    r5004 r7637  
    3838#include <tcl.h>
    3939
    40 static int set_session_option(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
     40#ifdef __GNUC__
     41#define UNUSED __attribute__ ((unused))
     42#else
     43#define UNUSED
     44#endif
     45
     46static int set_session_option(ClientData clientData UNUSED, Tcl_Interp *interp UNUSED, int objc UNUSED, Tcl_Obj *CONST objv[] UNUSED) {
    4147    return TCL_OK;
    4248}
    4349
    44 void parse_port_conf(dp_session_t dp, char* path) {
     50void parse_port_conf(dp_session_t dp UNUSED, char* path) {
    4551    int fd = open(path, O_RDONLY, 0);
    4652    if (fd != -1) {
     
    5359            ++option;
    5460        }
    55         // XXX: parse config file
     61        /* XXX: parse config file */
    5662    }
    5763}
  • trunk/base/src/darwinports1.0/session.c

    r4925 r7637  
    6363    struct session* dp = (struct session*)malloc(sizeof(struct session));
    6464    char* path;
    65     //dp_array_t conf_files = dp_array_create();
     65    /* dp_array_t conf_files = dp_array_create(); */
    6666   
    6767    dp->portconf = NULL;
     
    7171    if (path != NULL && access(path, R_OK) == 0) {
    7272        dp->portconf = strdup(path);
    73         //dp_array_append(conf_files, dp->portconf);
     73        /* dp_array_append(conf_files, dp->portconf); */
    7474    }
    7575
     
    8282            if (access(path, R_OK) == 0) {
    8383                dp->portconf = strdup(path);
    84                 //dp_array_append(conf_files, dp->portconf);
     84                /* dp_array_append(conf_files, dp->portconf); */
    8585            }
    8686        }
     
    8989    /* finally /etc/ports/ports.conf, or whatever path was configured */
    9090    if (dp->portconf == NULL) {
    91         // XXX: honor autoconf setting ($dports_conf_path)
     91      /* XXX: honor autoconf setting ($dports_conf_path) */
    9292        char* path = "/etc/ports/ports.conf";
    9393        if (access(path, R_OK) == 0) {
    9494            dp->portconf = strdup(path);
    95             //dp_array_append(conf_files, dp->portconf);
     95            /* dp_array_append(conf_files, dp->portconf); */
    9696        }
    9797    }
    9898   
    99     // foreach conf_files
     99    /* foreach conf_files */
    100100    {
    101101        int fd = open(dp->portconf, O_RDONLY, 0);
    102102        if (fd != -1) {
    103             // XXX: parse config file
     103          /* XXX: parse config file */
    104104        }
    105105    }
  • trunk/base/src/darwinports1.0/util.c

    r3547 r7637  
    7171void dp_array_append(dp_array_t a, const void* data) {
    7272    Tcl_Obj* array = (Tcl_Obj*)a;
    73     Tcl_Obj* obj = Tcl_NewByteArrayObj((char*)&data, sizeof(void*));
     73    Tcl_Obj* obj = Tcl_NewByteArrayObj((unsigned char*)&data, sizeof(void*));
    7474    Tcl_ListObjAppendElement(_util_interp, array, obj);
    7575}
  • trunk/base/src/darwinports1.0/util.h

    r4092 r7637  
    4141int dp_hash_get_count(dp_hash_t h);
    4242const void* dp_hash_get_value(dp_hash_t h, const void* key);
    43 // something for delete
     43/* something for delete */
    4444
    4545#endif /* __UTIL_H__ */
Note: See TracChangeset for help on using the changeset viewer.