From: <hek...@ya...> - 2004-04-08 23:35:56
|
Hello, The following patch is some minor clean up for variable declaration to make TIPC compilable by some earlier version of gcc which requires all variable declarations are in the beginning of a block. Let me know if you have any concerns in this: Thanks Kevin ---------------------------------------- Index: proc.c =================================================================== RCS file: /cvsroot/tipc/source/unstable/net/tipc/linux-2.4/proc.c,v retrieving revision 1.1 diff -c -r1.1 proc.c *** proc.c 27 Mar 2004 01:11:53 -0000 1.1 --- proc.c 8 Apr 2004 23:21:05 -0000 *************** *** 390,399 **** proc_nb_to_addr(int procNb) { int zone = procNb / MAX_PROCS_BY_SUBNET; - zone++; int processor = procNb % MAX_PROCS_BY_SUBNET; - processor++; tipc_ref_t ret; ret = (zone << 24) + (zone << 12) + processor; return ret; } --- 390,399 ---- proc_nb_to_addr(int procNb) { int zone = procNb / MAX_PROCS_BY_SUBNET; int processor = procNb % MAX_PROCS_BY_SUBNET; tipc_ref_t ret; + zone++; + processor++; ret = (zone << 24) + (zone << 12) + processor; return ret; } *************** *** 1013,1018 **** --- 1013,1019 ---- tipc_ref_t *port_id = NULL; struct tipc_cmd_msg cmd_msg; struct tipc_msg_section msg; + struct tipc_get_name_table_argv name_table_argv; tipc_msg_event cb = NULL; //printk("manager2\n"); *************** *** 1064,1070 **** break; case (NAME_TABLE_TYPE): port_id = &port_id_name_table; - struct tipc_get_name_table_argv name_table_argv; name_table_argv.type = 0; name_table_argv.depth = htonl(value); //only works for 0?? cb = (tipc_msg_event) get_name_table_cb; --- 1065,1070 ---- *************** *** 1660,1670 **** { struct proc_dir_entry *zoneTmpDir, *subnetTmpDir, *procTmpDir, *fileTmp; ! int zone, proc, i; char name[LINK_NAME_LENGTH]; zone = tipc_zone(addr) - 1; proc = tipc_node(addr) - 1; ! int procNb = (zone * MAX_PROCS_BY_SUBNET) + proc; //proc already exists (should not happen, it's a security for integrity) if ((zones[zone] == 1) && (subnets[zone] != NULL) && (procs[procNb] != NULL)) { --- 1660,1670 ---- { struct proc_dir_entry *zoneTmpDir, *subnetTmpDir, *procTmpDir, *fileTmp; ! int zone, proc, i, procNb; char name[LINK_NAME_LENGTH]; zone = tipc_zone(addr) - 1; proc = tipc_node(addr) - 1; ! procNb = (zone * MAX_PROCS_BY_SUBNET) + proc; //proc already exists (should not happen, it's a security for integrity) if ((zones[zone] == 1) && (subnets[zone] != NULL) && (procs[procNb] != NULL)) { *************** *** 1752,1761 **** { char name[LINK_NAME_LENGTH]; ! int zone, proc, i, flag = 1; zone = tipc_zone(addr) - 1; proc = tipc_node(addr) - 1; ! int procNb = (zone * MAX_PROCS_BY_SUBNET) + proc; //remove the specified processor if (procs[procNb] != NULL) { //free the LinkNames array of the processors and the Links Directory --- 1752,1761 ---- { char name[LINK_NAME_LENGTH]; ! int zone, proc, i, procNb, flag = 1; zone = tipc_zone(addr) - 1; proc = tipc_node(addr) - 1; ! procNb = (zone * MAX_PROCS_BY_SUBNET) + proc; //remove the specified processor if (procs[procNb] != NULL) { //free the LinkNames array of the processors and the Links Directory *************** *** 1917,1922 **** --- 1917,1923 ---- char cb_name[50] = { 0 }; const char *cb_result = NULL; char *available; + char *bearer_name; char procResult[100] = { 0 }; *************** *** 1953,1959 **** sprintf(cb_name, "%s", "get_processors"); proc_info = get_parent_proc_info(info->this, 1); //printk("procinfo.addr: %u\n", proc_info.proc_addr); ! int ret =ask_manager_and_wait(PROCESSORS_TYPE, "get_processors", &get_processors_cb_done, 0, 0, NULL, 0); print_manager_return_value(ret, cb_name); if (ret != -1) { --- 1954,1960 ---- sprintf(cb_name, "%s", "get_processors"); proc_info = get_parent_proc_info(info->this, 1); //printk("procinfo.addr: %u\n", proc_info.proc_addr); ! ret =ask_manager_and_wait(PROCESSORS_TYPE, "get_processors", &get_processors_cb_done, 0, 0, NULL, 0); print_manager_return_value(ret, cb_name); if (ret != -1) { *************** *** 2074,2080 **** case (DISABLE_BEARER_TYPE): sprintf(cb_name, "%s", "disable_bearer"); proc_info = get_parent_proc_info(info->this, 4); - char *bearer_name; bearer_name = bearer_name_from_dir(info->this); ret =ask_manager_and_wait(DISABLE_BEARER_TYPE, cb_name, &second_cmd_group_cb_done, 1, proc_info.proc_addr, bearer_name, 0); --- 2075,2080 ---- Index: udp_media.c =================================================================== RCS file: /cvsroot/tipc/source/unstable/net/tipc/linux-2.4/udp_media.c,v retrieving revision 1.1 diff -c -r1.1 udp_media.c *** udp_media.c 27 Mar 2004 01:11:53 -0000 1.1 --- udp_media.c 8 Apr 2004 23:21:06 -0000 *************** *** 207,212 **** --- 207,213 ---- struct sockaddr_in t_addr; struct sock *sk; struct sockaddr_in l_addr; + struct net_device *dev; uint one = 1; mm_segment_t saved_addr = get_fs(); b->usr_handle = &bearer; *************** *** 281,287 **** if (udp0 >= TIPC_NODE_SCOPE) return 1; ! struct net_device *dev = dev_base; while (dev) { struct ip_mreqn mreqn; mreqn.imr_multiaddr.s_addr = --- 282,288 ---- if (udp0 >= TIPC_NODE_SCOPE) return 1; ! dev = dev_base; while (dev) { struct ip_mreqn mreqn; mreqn.imr_multiaddr.s_addr = |