3 Whistles -- there is a major disaster or danger, come running, watch out, etc.
as many as it takes..-- when throwing to a swimmer and you do not have eye contact.
Other then that in general a whistle should probably not be used.
However after saying that last bit.. I believe that the above should generally apply in situations where you may have many different groups paddling (e.g. say the Ark, or the Poudre). If too many people are out there blowing just one whistle blast meaning "hey pay attention" or watch me, or it's clear, or... it could sound to someone outside the groups the "dreaded" 3 whistle blows. Think of a garage full of cars with several car alarms going off -- they will eventual get ignored.
On the flip side, one group, with proper proper communication on the meaning of the different whistle blows, a whistle can be a very good means of communication. For example say safety has been set up for a sketchy drop and the eddy where the paddlers start from is out of the line of sight from the safety group. The safety could use a whistle to signal that it's now clear and the next boater may proceed.
btw -- a lot of this should be covered in a good swiftwater rescue class...