Dress codes vary widely depending on the cruiseline. In the buffet reguardless of cruise line Jeans and a t-shirt should be find there. Also I would think that shorts and tank tops would be fine in the buffet area. Just not a bathsuit by itself. Flip-flops are also fine in the buffet area. Eating any meals (Breakfast, Lunch, and dinner) in the dining room does require nice dress. No tank tops, no flip flops.
If you are on Carnival this cruiseline no longer prohibits jeans in the dining room so on casual night on a carnival cruise a nice jean is allowed. However, the other extreme is Celebrity in which case jeans are prohibited from the dining room. Carnival has only has Formal and Smart Casual nights. Celebrity has Formal, Informal and smart Casual nights. Informal is a nice pant suit, or a nice dress suit and casual is a nice pant and blouse (no t-shirts, no jeans). I hope that helped and didn't just confuse you more.