summaryrefslogtreecommitdiff
path: root/gcc/ada/g-socket.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2017-01-13 10:19:19 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2017-01-13 10:19:19 +0000
commit99378362755a60c33ff00332ff58e05bc51d9da2 (patch)
treef478a14a0fa94b8594e529f0aa178c5afedad3df /gcc/ada/g-socket.adb
parent0b20de783f72340539a204893ed33a6370e949fe (diff)
downloadgcc-99378362755a60c33ff00332ff58e05bc51d9da2.tar.gz
2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
* sem_aggr.adb, par_sco.adb, s-osprim-mingw.adb, exp_ch5.adb, exp_prag.adb, sem_ch3.adb, xr_tabls.adb, lib-xref-spark_specific.adb, layout.adb, sem_dist.adb, exp_spark.adb, exp_ch7.adb, gnatcmd.adb, exp_util.adb, prj-proc.adb, sem_aux.adb, comperr.adb, g-memdum.adb, exp_attr.adb, s-intman-solaris.adb, exp_ch9.adb, make.adb, live.adb, g-sercom-linux.adb, sem_dim.adb, mlib-prj.adb, s-intman-posix.adb, sem_ch9.adb, sem_ch10.adb, prep.adb, einfo.adb, scng.adb, checks.adb, prj-strt.adb, sem_prag.adb, eval_fat.adb, sem_ch12.adb, sem.adb, a-numaux-x86.adb, a-stwifi.adb, i-cobol.adb, prj.adb, get_spark_xrefs.adb, s-tasini.adb, rtsfind.adb, freeze.adb, g-arrspl.adb, par-ch4.adb, sem_util.adb, sem_res.adb, expander.adb, sem_attr.adb, exp_dbug.adb, prj-pp.adb, a-stzfix.adb, s-interr.adb, s-wchcnv.adb, switch-m.adb, gnat1drv.adb, sinput-l.adb, stylesw.adb, contracts.adb, s-intman-android.adb, g-expect.adb, exp_ch4.adb, g-comlin.adb, errout.adb, sinput.adb, s-exctra.adb, repinfo.adb, g-spipat.adb, g-debpoo.adb, exp_ch6.adb, sem_ch4.adb, exp_ch13.adb, a-wtedit.adb, validsw.adb, pprint.adb, widechar.adb, makeutl.adb, ali.adb, set_targ.adb, sem_mech.adb, sem_ch6.adb, gnatdll.adb, get_scos.adb, g-pehage.adb, s-tratas-default.adb, gnatbind.adb, prj-dect.adb, g-socthi-mingw.adb, par-prag.adb, prj-nmsc.adb, exp_disp.adb, par-ch12.adb, binde.adb, sem_ch8.adb, s-tfsetr-default.adb, s-regexp.adb, gprep.adb, s-tpobop.adb, a-teioed.adb, sem_warn.adb, sem_eval.adb, g-awk.adb, s-io.adb, a-ztedit.adb, xoscons.adb, exp_intr.adb, sem_cat.adb, sprint.adb, g-socket.adb, exp_dist.adb, sem_ch13.adb, s-tfsetr-vxworks.adb, par-ch3.adb, treepr.adb, g-forstr.adb, g-catiio.adb, par-ch5.adb, uname.adb, osint.adb, exp_ch3.adb, prj-env.adb, a-strfix.adb, a-stzsup.adb, prj-tree.adb, s-fileio.adb: Update all eligible case statements to reflect the new style for case alternatives. Various code clean up and reformatting. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@244406 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/g-socket.adb')
-rw-r--r--gcc/ada/g-socket.adb119
1 files changed, 64 insertions, 55 deletions
diff --git a/gcc/ada/g-socket.adb b/gcc/ada/g-socket.adb
index 29ede344b04..a8b718a511a 100644
--- a/gcc/ada/g-socket.adb
+++ b/gcc/ada/g-socket.adb
@@ -1169,28 +1169,30 @@ package body GNAT.Sockets is
end if;
case Name is
- when Multicast_Loop |
- Multicast_TTL |
- Receive_Packet_Info =>
+ when Multicast_Loop
+ | Multicast_TTL
+ | Receive_Packet_Info
+ =>
Len := V1'Size / 8;
Add := V1'Address;
- when Generic_Option |
- Keep_Alive |
- Reuse_Address |
- Broadcast |
- No_Delay |
- Send_Buffer |
- Receive_Buffer |
- Multicast_If |
- Error |
- Busy_Polling =>
+ when Broadcast
+ | Busy_Polling
+ | Error
+ | Generic_Option
+ | Keep_Alive
+ | Multicast_If
+ | No_Delay
+ | Receive_Buffer
+ | Reuse_Address
+ | Send_Buffer
+ =>
Len := V4'Size / 8;
Add := V4'Address;
- when Send_Timeout |
- Receive_Timeout =>
-
+ when Receive_Timeout
+ | Send_Timeout
+ =>
-- The standard argument for SO_RCVTIMEO and SO_SNDTIMEO is a
-- struct timeval, but on Windows it is a milliseconds count in
-- a DWORD.
@@ -1204,12 +1206,12 @@ package body GNAT.Sockets is
Add := VT'Address;
end if;
- when Linger |
- Add_Membership |
- Drop_Membership =>
+ when Add_Membership
+ | Drop_Membership
+ | Linger
+ =>
Len := V8'Size / 8;
Add := V8'Address;
-
end case;
Res :=
@@ -1228,44 +1230,48 @@ package body GNAT.Sockets is
Opt.Optname := Onm;
Opt.Optval := V4;
- when Keep_Alive |
- Reuse_Address |
- Broadcast |
- No_Delay =>
+ when Broadcast
+ | Keep_Alive
+ | No_Delay
+ | Reuse_Address
+ =>
Opt.Enabled := (V4 /= 0);
when Busy_Polling =>
Opt.Microseconds := Natural (V4);
- when Linger =>
+ when Linger =>
Opt.Enabled := (V8 (V8'First) /= 0);
Opt.Seconds := Natural (V8 (V8'Last));
- when Send_Buffer |
- Receive_Buffer =>
+ when Receive_Buffer
+ | Send_Buffer
+ =>
Opt.Size := Natural (V4);
- when Error =>
+ when Error =>
Opt.Error := Resolve_Error (Integer (V4));
- when Add_Membership |
- Drop_Membership =>
+ when Add_Membership
+ | Drop_Membership
+ =>
To_Inet_Addr (To_In_Addr (V8 (V8'First)), Opt.Multicast_Address);
To_Inet_Addr (To_In_Addr (V8 (V8'Last)), Opt.Local_Interface);
- when Multicast_If =>
+ when Multicast_If =>
To_Inet_Addr (To_In_Addr (V4), Opt.Outgoing_If);
- when Multicast_TTL =>
+ when Multicast_TTL =>
Opt.Time_To_Live := Integer (V1);
- when Multicast_Loop |
- Receive_Packet_Info =>
+ when Multicast_Loop
+ | Receive_Packet_Info
+ =>
Opt.Enabled := (V1 /= 0);
- when Send_Timeout |
- Receive_Timeout =>
-
+ when Receive_Timeout
+ | Send_Timeout
+ =>
if Target_OS = Windows then
-- Timeout is in milliseconds, actual value is 500 ms +
@@ -2296,10 +2302,11 @@ package body GNAT.Sockets is
Len := V4'Size / 8;
Add := V4'Address;
- when Keep_Alive |
- Reuse_Address |
- Broadcast |
- No_Delay =>
+ when Broadcast
+ | Keep_Alive
+ | No_Delay
+ | Reuse_Address
+ =>
V4 := C.int (Boolean'Pos (Option.Enabled));
Len := V4'Size / 8;
Add := V4'Address;
@@ -2309,49 +2316,52 @@ package body GNAT.Sockets is
Len := V4'Size / 8;
Add := V4'Address;
- when Linger =>
+ when Linger =>
V8 (V8'First) := C.int (Boolean'Pos (Option.Enabled));
V8 (V8'Last) := C.int (Option.Seconds);
Len := V8'Size / 8;
Add := V8'Address;
- when Send_Buffer |
- Receive_Buffer =>
+ when Receive_Buffer
+ | Send_Buffer
+ =>
V4 := C.int (Option.Size);
Len := V4'Size / 8;
Add := V4'Address;
- when Error =>
+ when Error =>
V4 := C.int (Boolean'Pos (True));
Len := V4'Size / 8;
Add := V4'Address;
- when Add_Membership |
- Drop_Membership =>
+ when Add_Membership
+ | Drop_Membership
+ =>
V8 (V8'First) := To_Int (To_In_Addr (Option.Multicast_Address));
V8 (V8'Last) := To_Int (To_In_Addr (Option.Local_Interface));
Len := V8'Size / 8;
Add := V8'Address;
- when Multicast_If =>
+ when Multicast_If =>
V4 := To_Int (To_In_Addr (Option.Outgoing_If));
Len := V4'Size / 8;
Add := V4'Address;
- when Multicast_TTL =>
+ when Multicast_TTL =>
V1 := C.unsigned_char (Option.Time_To_Live);
Len := V1'Size / 8;
Add := V1'Address;
- when Multicast_Loop |
- Receive_Packet_Info =>
+ when Multicast_Loop
+ | Receive_Packet_Info
+ =>
V1 := C.unsigned_char (Boolean'Pos (Option.Enabled));
Len := V1'Size / 8;
Add := V1'Address;
- when Send_Timeout |
- Receive_Timeout =>
-
+ when Receive_Timeout
+ | Send_Timeout
+ =>
if Target_OS = Windows then
-- On Windows, the timeout is a DWORD in milliseconds, and
@@ -2375,7 +2385,6 @@ package body GNAT.Sockets is
Len := VT'Size / 8;
Add := VT'Address;
end if;
-
end case;
if Option.Name in Specific_Option_Name then