the hammocks had been unslung from their positions lining the bulwarks of the galleon where they had been packed as protection from arrows and musket-fire ; the men lay alongside each other , crammed together like sardines , head-to-toe , rocking gently from side-to-side as the ship carved its way through the heavy swells of the pacific ocean .