On a hammergun, the hammers are the safety - the gun is safe until the hammers are pulled back.
The earliest pinfire and centrefire hammerguns of the 1850s and 1860s had a half-cock position (see my thread below on the pinfire game gun), and the rebounding lock invented in the late 1860s did away with the half-cock on centrefire guns..
In the case of a hammerless boxlock, the hidden hammers are always at full-cock, thereby various mechanical safeties were invented to prevent an accidental discharge. It is probably a bit more complicated than that, but you get the idea!